[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Attribute Name to Elements Problems

Subject: Attribute Name to Elements Problems
From: "Benjamin Richard Woline" <valjean@xxxxxxxxxxx>
Date: Wed, 20 Jul 2005 15:53:21 -0500 (CDT)
name of elements
Now that I have my XML sorted (Thanks to DavidC) I can't seem to get the
structure to reform itself based on an attribute name.

My XML now looks like:

<Entry>
<Entry name="H" type="System" importance="1">
  <Entry name="I" type="Category" importance="1">
    <Entry name="J" type="Item" importance="1"></Entry>
    <Entry name="K" type="Item" importance="2"></Entry>
  </Entry>
  <Entry name="L" type="Category" importance="2">
    <Entry name="N" type="Item" importance="1"></Entry>
    <Entry name="M" type="Item" importance="2"></Entry>
  </Entry>
</Entry>
<Entry name="A" type="System" importance="2">
  <Entry name="E" type="Category" importance="1">
    <Entry name="G" type="Item" importance="1"></Entry>
    <Entry name="F" type="Item" importance="2"></Entry>
  </Entry>
  <Entry name="B" type="Category" importance="2">
    <Entry name="C" type="Item" importance="1"></Entry>
    <Entry name="D" type="Item" importance="2"></Entry>
  </Entry>
</Entry>
</Entry>

I want to reform it by "type" with some new elements created so that the XML
looks like:

<Entry>
<System type="System" importance="1"><name>H</name>
  <Category type="Category" importance="1"><name>I</name>
    <Item type="Item" importance="1"><name>J</name></Item>
    <Item type="Item" importance="2"><name>K</name></Item>
  </Category>
  <Category type="Category" importance="2"><name>L</name>
    <Item type="Item" importance="1"><name>N</name></Item>
    <Item type="Item" importance="2"><name>M</name></Item>
  </Category>
</System>
<System type="System" importance="2"><name>A</name>
  <Category type="Category" importance="1"><name>E</name>
    <Item type="Item" importance="1"><name>G</name></Item>
    <Item type="Item" importance="2"><name>F</name></Item>
  </Category>
  <Category type="Category" importance="2"><name>B</name>
    <Item type="Item" importance="1"><name>C</name></Entry>
    <Item type="Item" importance="2"><name>D</name></Entry>
  </Category>
</System>
</Entry>


When I try something with <xsl:element name="{@Type}"> I get not valid type not
a QName, so something is very wrong.  There are several attributes other than
name that I want to pull out into elements so hopefully there is a "generic"
solution.  Hope someone can help.

Ben Woline

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.