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

RE: Plural attribute values versus a separate element.

Subject: RE: Plural attribute values versus a separate element.
From: Ed Blachman <EdB@xxxxxxxxxxx>
Date: Fri, 23 Aug 2002 12:25:23 -0400
plural elements in xsl
> -----Original Message-----
> From: Edward L. Knoll [mailto:ed.knoll@xxxxxxxxxxxxxx]
> Sent: Friday, August 23, 2002 11:35 AM
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Plural attribute values versus a separate element.
> 
> I have a element which may be plural.  Every
> instance of that element share a common "type" attribute, but the "type"
> values can be plural.  Well formed XML requires attributes to be unique
> for a specific element instance.
> 
> I suspect that I should turn this attribute into a peer element.  Does
> anyone have insight into this problem?

Seems to me that your best bet would be to use child elements, not peer
elements.

That is: if in your Approach A you might see

<element type="A,B">...</element>
<element type="A,C,X">...</element>

you could instead use a child element

<element>
   <type>A</type>
   <type>B</type>
   ...
</element>
<element>
   <type>A</type>
   <type>C</type>
   <type>X</type>
   ...
</element>

You get the multiplicity you want in a manner that's amenable to XPath
querying without having to resort to string manipulation.

Ed Blachman
Trellix Corporation

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.