Click here to Skip to main content
15,918,343 members
Home / Discussions / XML / XSL
   

XML / XSL

 
QuestionCreating a XML and XSD for data storage. Starting with empty xml Pin
steve_rm24-Mar-08 23:32
steve_rm24-Mar-08 23:32 
Questionload xml+xsl in html Pin
Member 466072419-Mar-08 21:12
Member 466072419-Mar-08 21:12 
GeneralRe: load xml+xsl in html Pin
led mike20-Mar-08 4:47
led mike20-Mar-08 4:47 
GeneralRe: load xml+xsl in html Pin
Aurelius166420-Mar-08 5:25
Aurelius166420-Mar-08 5:25 
GeneralRe: load xml+xsl in html Pin
Member 466072423-Mar-08 22:16
Member 466072423-Mar-08 22:16 
QuestionCombine several xml schemata in a single file? Pin
maki.stud17-Mar-08 3:59
maki.stud17-Mar-08 3:59 
Questionhow to code some sql properties in xsd? [modified] Pin
khinezw17-Mar-08 3:08
khinezw17-Mar-08 3:08 
QuestionHow to XSL this XML file? Pin
ASCIIyhr16-Mar-08 10:07
ASCIIyhr16-Mar-08 10:07 
Hi,

I'm wondering if anybody could help me with the following?

I have this XML:


<?xml version="1.0" encoding="utf-8"?>
<dataset xmlns="http://developer.cognos.com/schemas/xmldata/1/" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<!--
<dataset
xmlns="http://developer.cognos.com/schemas/xmldata/1/"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://developer.cognos.com/schemas/xmldata/1/ xmldata.xsd"
>
-->
<metadata>
<item name="Product type" type="xs:string" length="102"/>
<item name="Quantity" type="xs:int" precision="1"/>
</metadata>
<data>
<row>
<value>Binoculars</value>
<value>1075087</value>
</row>
<row>
<value>Climbing Accessories</value>
<value>5850251</value>
</row>
<row>
<value>Cooking Gear</value>
<value>13400351</value>
</row>
</data>
</dataset>


which I want to transform to the following using XSL (the number of row nodes is not fixed):


<?xml version="1.0" encoding="utf-8"?>
<data>
<row
ProductType="Binoculars"
Quantity="1075087"
/>
<row
ProductType="Climbing Accessories"
Quantity="5850251"
/>
<row
ProductType="Cooking Gear"
Quantity="13400351"
/>
</data>


Please notice that the metadata node (in the source XML) contains the names to be used in the resulting XML file as attribute names and that the name can contain one or more spaces (as indicated below in the name "Product yype").


<metadata>
<item name="Product type" type="xs:string" length="102"/>
<item name="Quantity" type="xs:int" precision="1"/>
</metadata>

Thank you very much in advance... Smile | :)
Generalsetting XML Schema Restriction Pin
laziale14-Mar-08 4:11
laziale14-Mar-08 4:11 
AnswerRe: setting XML Schema Restriction Pin
buchstaben15-Mar-08 6:05
buchstaben15-Mar-08 6:05 
GeneralRe: setting XML Schema Restriction Pin
laziale15-Mar-08 6:16
laziale15-Mar-08 6:16 
QuestionCombining XmlNodeList with another? Pin
Peter Nap11-Mar-08 23:37
Peter Nap11-Mar-08 23:37 
GeneralRe: Combining XmlNodeList with another? Pin
led mike13-Mar-08 4:30
led mike13-Mar-08 4:30 
Questionxml file bind into data grib view from window in C# Pin
thanhtikezaw11-Mar-08 0:24
thanhtikezaw11-Mar-08 0:24 
Generalcross post (ignore) Pin
led mike11-Mar-08 6:00
led mike11-Mar-08 6:00 
Questionhow do i Deserialize a xml docuement that contains reserve char in .net 1.1 Pin
abstar10-Mar-08 13:01
abstar10-Mar-08 13:01 
GeneralRe: how do i Deserialize a xml docuement that contains reserve char in .net 1.1 Pin
led mike11-Mar-08 5:56
led mike11-Mar-08 5:56 
GeneralGetting Crazy with Excel XML File Creation Pin
Bodo van Laak7-Mar-08 5:48
Bodo van Laak7-Mar-08 5:48 
GeneralRe: Getting Crazy with Excel XML File Creation Pin
Bodo van Laak8-Mar-08 6:06
Bodo van Laak8-Mar-08 6:06 
GeneralHelp embed function in xslt Pin
GISBingBing4-Mar-08 21:21
professionalGISBingBing4-Mar-08 21:21 
QuestionCan I protect Xml file with password? Pin
phowarso4-Mar-08 6:08
phowarso4-Mar-08 6:08 
AnswerRe: Can I protect Xml file with password? Pin
led mike5-Mar-08 5:12
led mike5-Mar-08 5:12 
Generalcreating an xml file based on the parameters and XML Schema Pin
elizabethsheeba4-Mar-08 4:02
elizabethsheeba4-Mar-08 4:02 
GeneralRe: creating an xml file based on the parameters and XML Schema Pin
led mike4-Mar-08 12:03
led mike4-Mar-08 12:03 
Question[Message Deleted] Pin
Lavanya Madan3-Mar-08 20:27
Lavanya Madan3-Mar-08 20:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.