Click here to Skip to main content
15,889,034 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: how do i read the specific tag ? Pin
George L. Jackson22-Apr-09 2:43
George L. Jackson22-Apr-09 2:43 
QuestionXML NODE Pin
kibromg8-Apr-09 0:15
kibromg8-Apr-09 0:15 
AnswerRe: XML NODE Pin
led mike8-Apr-09 5:17
led mike8-Apr-09 5:17 
QuestionLimit length (number of characters) returned in <%#XPath("description")%> ? Pin
cbvoss2-Apr-09 16:12
cbvoss2-Apr-09 16:12 
AnswerRe: Limit length (number of characters) returned in <%#XPath("description")%> ? Pin
cbvoss3-Apr-09 6:38
cbvoss3-Apr-09 6:38 
Questionneed to get data from xml to verify login Pin
faizych2-Apr-09 9:37
faizych2-Apr-09 9:37 
AnswerRe: need to get data from xml to verify login Pin
Le centriste6-Apr-09 6:03
Le centriste6-Apr-09 6:03 
QuestionGroup XML by category Pin
blindcapt1-Apr-09 16:26
blindcapt1-Apr-09 16:26 
I was hoping someone could give me a hand with this. I'd like to convert a standard XML file into one that groups the data by one of the data elements.

Here is a sample of data I'd be using:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Inventory>
<Item>
<producttype>Book</producttype>
<productname>A Connecticut Yankee in King Arthur's Court</productname>
<artistfirstname>Mark</artistfirstname>
<artistlastname>Twain</artistlastname>
<description>A Connecticut Yankee travels back to King Arthur's court and adventure ensues. Fun, fun, fun.</description>
<company>Pocket Books</company>
<year>1889</year>
<productid>978-1416534730</productid>
<price>4.95</price>
<image/>
</Item>
<Item>
<producttype>Book</producttype>
<productname>A Farewell To Arms</productname>
<artistfirstname>Ernest</artistfirstname>
<artistlastname>Hemingway</artistlastname>
<description>The tragic tale of love and loss during WWI.</description>
<company>Charles Scribner's Sons</company>
<year>1929</year>
<productid>978-0684837888</productid>
<price>18.15</price>
<image href="file://images/978-0684837888.jpg"/>
</Item>
<Item>
<producttype>Book</producttype>
<productname>A Portrait of the Artist as a Young Man</productname>
<artistfirstname>James</artistfirstname>
<artistlastname>Joyce</artistlastname>
<description>A a fictionalized memoir of Joyce's alter ego, Stephen Daedelus, describing his coming of age in Dublin.</description>
<company>Everyman's Library</company>
<year>1916</year>
<productid>978-0679405757</productid>
<price>14.25</price>
<image href="file://images/978-0679405757.jpg"/>
</Item>
<Item>
<producttype>Audiobook</producttype>
<productname>A Tale of Two Cities</productname>
<artistfirstname>Charles</artistfirstname>
<artistlastname>Dickens</artistlastname>
<description>Classic telling of life in two cities, London and Paris, during the upheaval of the French Revolution.</description>
<company>Blackstone Audiobooks</company>
<year>2005</year>
<productid>978-0786180394</productid>
<price>19.77</price>
<image href="file://images/978-0786180394.jpg"/>
</Item>
<Item>
<producttype>Audiobook</producttype>
<productname>Anna Karenina</productname>
<artistfirstname>Leo</artistfirstname>
<artistlastname>Tolstoy</artistlastname>
<description>Audiobook version of the intricate intrigue of love and scandal in high society of Czarist Russia.</description>
<company>Naxos Audiobooks</company>
<year>1999</year>
<productid>978-9626340813</productid>
<price>20.55</price>
<image href="file://images/978-9626340813.jpg"/>
</Item>
</Inventory>

I'd like to end up with something like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Inventory>
<category>
<type>Book</type>
<Item>
<productname>A Connecticut Yankee in King Arthur's Court</productname>
<artistfirstname>Mark</artistfirstname>
<artistlastname>Twain</artistlastname>
<description>A Connecticut Yankee travels back to King Arthur's court and adventure ensues. Fun, fun, fun.</description>
<company>Pocket Books</company>
<year>1889</year>
<productid>978-1416534730</productid>
<price>4.95</price>
<image/>
</Item>
<Item>
<productname>A Farewell To Arms</productname>
<artistfirstname>Ernest</artistfirstname>
<artistlastname>Hemingway</artistlastname>
<description>The tragic tale of love and loss during WWI.</description>
<company>Charles Scribner's Sons</company>
<year>1929</year>
<productid>978-0684837888</productid>
<price>18.15</price>
<image href="file://images/978-0684837888.jpg"/>
</Item>
<Item>
<productname>A Portrait of the Artist as a Young Man</productname>
<artistfirstname>James</artistfirstname>
<artistlastname>Joyce</artistlastname>
<description>A a fictionalized memoir of Joyce's alter ego, Stephen Daedelus, describing
his coming of age in Dublin.</description>
<company>Everyman's Library</company>
<year>1916</year>
<productid>978-0679405757</productid>
<price>14.25</price>
<image href="file://images/978-0679405757.jpg"/>
</Item>
</category>
<category>
<type>Audiobook</type>
<Item>
<productname>A Tale of Two Cities</productname>
<artistfirstname>Charles</artistfirstname>
<artistlastname>Dickens</artistlastname>
<description>Classic telling of life in two cities, London and Paris, during the
upheaval of the French Revolution.</description>
<company>Blackstone Audiobooks</company>
<year>2005</year>
<productid>978-0786180394</productid>
<price>19.77</price>
<image href="file://images/978-0786180394.jpg"/>
</Item>
<Item>
<productname>Anna Karenina</productname>
<artistfirstname>Leo</artistfirstname>
<artistlastname>Tolstoy</artistlastname>
<description>Audiobook version of the intricate intrigue of love and scandal in high
society of Czarist Russia.</description>
<company>Naxos Audiobooks</company>
<year>1999</year>
<productid>978-9626340813</productid>
<price>20.55</price>
<image href="file://images/978-9626340813.jpg"/>
</Item>
</category>
</Inventory>

Does anyone know how to write an XSLT to create this kind of grouping?

If you have any suggestions, I'd entertain any options.

Thanks
AnswerRe: Group XML by category Pin
led mike2-Apr-09 4:58
led mike2-Apr-09 4:58 
GeneralRe: Group XML by category Pin
blindcapt2-Apr-09 18:59
blindcapt2-Apr-09 18:59 
AnswerRe: Group XML by category Pin
Lee Humphries16-Apr-09 0:32
professionalLee Humphries16-Apr-09 0:32 
QuestionXSLT and the xml:base-uri attribute Pin
Lea Hayes31-Mar-09 11:51
Lea Hayes31-Mar-09 11:51 
Questiongenerate a result based on a XML file [modified] Pin
alexyxj31-Mar-09 6:36
alexyxj31-Mar-09 6:36 
AnswerRe: generate a result based on a XML file Pin
alexyxj31-Mar-09 6:37
alexyxj31-Mar-09 6:37 
GeneralRe: generate a result based on a XML file Pin
alexyxj3-Apr-09 11:00
alexyxj3-Apr-09 11:00 
QuestionRelaxNG Attribute Override Pin
Lea Hayes31-Mar-09 2:39
Lea Hayes31-Mar-09 2:39 
QuestionUpdate InfoPath option button using XML Pin
hoonzis26-Mar-09 5:54
hoonzis26-Mar-09 5:54 
QuestionInclude superscript and subscript in a XML. Pin
Vishnu Nath26-Mar-09 3:05
Vishnu Nath26-Mar-09 3:05 
AnswerRe: Include superscript and subscript in a XML. Pin
scottgp26-Mar-09 3:32
professionalscottgp26-Mar-09 3:32 
QuestionHow to include Word Place Holders into my xslt? Pin
Tejabhiram25-Mar-09 3:58
Tejabhiram25-Mar-09 3:58 
AnswerRe: How to include Word Place Holders into my xslt? Pin
led mike25-Mar-09 11:38
led mike25-Mar-09 11:38 
GeneralRe: How to include Word Place Holders into my xslt? Pin
Tejabhiram25-Mar-09 18:58
Tejabhiram25-Mar-09 18:58 
GeneralRe: How to include Word Place Holders into my xslt? Pin
led mike26-Mar-09 4:50
led mike26-Mar-09 4:50 
QuestionLinq to Xml Programming Pin
JimBob SquarePants24-Mar-09 6:58
JimBob SquarePants24-Mar-09 6:58 
AnswerCross Posted Pin
led mike24-Mar-09 8:44
led mike24-Mar-09 8:44 

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.