[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Plural attribute values versus a separate element.
> -----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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|