This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Plural attribute values versus a separate element.
- From: Ed Blachman <EdB at trellix dot com>
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Fri, 23 Aug 2002 12:25:23 -0400
- Subject: RE: [xsl] Plural attribute values versus a separate element.
- Reply-to: xsl-list at lists dot mulberrytech dot com
> -----Original Message-----
> From: Edward L. Knoll [mailto:ed.knoll@cosd.fedex.com]
> Sent: Friday, August 23, 2002 11:35 AM
> To: XSL-List@lists.mulberrytech.com
> Subject: [xsl] 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