This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Plural attribute values versus a separate element.


> -----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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]