473,769 Members | 6,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

forms, xslt and python

Hi!

I got an xml file that goes like this.

<question id=10 correct_answer= 2>
<alternative>An swer 1</alternative>
<alternative>An swer 2</alternative>
<alternative>An swer 3</alternative>
<alternative>An swer 4</alternative>
</question>

I've made an xslt transformation and put the alternatives into radio
buttons (html form) so the user can choose the correct answer by

I am able to list all the questions and the id's via via python and return
them to the webpage. Put how can I get the value from the alternative
element? How can I verify that the user have answered correct?
Regards
Frengky
Jul 18 '05 #1
1 1872
Firstly, that isn't an XML file. You're missing quotes around
attribute values.

Secondly, your question is very unclear. Are you looking for an XSLT
way to correlate the correct_answer attribute to the alternative
element in corresponding order? Are you looking for a Python means to
do this?
--
Uche Ogbuji Fourthought, Inc.
http://uche.ogbuji.net http://4Suite.org http://fourthought.com
Use CSS to display XML -
http://www.ibm.com/developerworks/ed...-xmlcss-i.html
Introducing the Amara XML Toolkit -
http://www.xml.com/pub/a/2005/01/19/amara.html
Be humble, not imperial (in design) -
http://www.adtmag.com/article.asp?id=10286Querying WordNet as XML -
http://www.ibm.com/developerworks/xm...x-think29.html
Manage XML collections with XAPI -
http://www-106.ibm.com/developerwork...ry/x-xapi.html
Default and error handling in XSLT lookup tables -
http://www.ibm.com/developerworks/xm...x-tiplook.html
Packaging XSLT lookup tables as EXSLT functions -
http://www.ibm.com/developerworks/xm...-tiplook2.html

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1910
by: Doug Farrell | last post by:
Hi all, I'm trying to use the 4Suite xml/xsl tools to transform some XML data into HTML. I'm using some examples from the O'Reilly book "Python and XML" and things are blowing up. Here is the little piece of code I'm working on: from xml.xslt.Processor import Processor proc = Processor()
5
19365
by: K. N. | last post by:
Is there any good and fast Python module for XSLT processing ? I'm going to use XML and XSLT to generate web pages, so I need XSLT processor that will be able to transform for example a DOM object in memory - I don't want to create XML file containing data and then load it and transform with XSLT, but I want to do this at once - without writing to a temporary file. Actually I've seen alot articles about parsing XML, but nothing about...
1
2643
by: Olivier Hoarau | last post by:
Hello, I would like to create a file from a xml file with a xslt transformation in a python program. Is there someone who can give me some examples to do that ? something like this import libxslt import libxml2
1
5076
by: Yannick Patois | last post by:
Hi, I would like to merge two XML document, or more exacly enrich a document by inheritiong from another. I read a bit about XSLT and I know a bit of python/sax/dom, and I dont know where I should go. I tried xslt, without success yet (but I dont know much about it) so I failed back on python+dom wher I know a bit more. I'm asking you if it's a good choice, or if I should use XSLT for this.
0
1505
by: Marcel Stör | last post by:
Hi all, For one customer we need to transform some 100 business forms (registration forms, etc.) into XSLT:FO templates - our application will produce PDF documents. Up to now our intern has created those templates by hand using the XslFast tool. For such a big number of business forms, however, this is just too time consumeing. Is there a way to automate this process? It would be great if I could just scan the forms, have some OCR...
1
412
by: K.Simon | last post by:
Hello, I'm looking for a possibility to execute a program like a python-script within a xslt-stylesheet. I read sometime ago that there exists a way to do so. Could somebody explain how? I would appreciate any assistance. Kai
3
3092
by: Ian Roddis | last post by:
Hello, I want to embed SQL type queries within an XML data record. The XML looks something like this: <DISPLAYPAGE> <FIELD NAME="SERVER" TYPE="DROPDOWN"> <OPTION>1<OPTION> <OPTION>2<OPTION> <OPTION>3<OPTION> </FIELD>
2
2138
by: veracon | last post by:
Hello, I'm looking to use XML and XSLT for templates in a system I'm writing, however I'm not really sure which parser is the "best". Basically, which library has the most features, and which is the most supported? A guide I saw mentioned importing xml.xslt, however it appears the xml module/package contains pretty much nothing - xml.xslt outputs an exception, No module named xslt.
21
2543
by: Damian | last post by:
Hi, I'm from an ASP.NET background an am considering making the switch to Python. I decided to develop my next project in tandem to test the waters and everything is working well, loving the language, etc. What I've got is: two websites, one in ASP.NET v2 and one in Python 2.5 (using 4suite for XML/XSLT) both on the same box (Windows Server 2003) both using the same XML, XSLT, CSS
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10211
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5299
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3959
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.