|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Matching elements with a name specified by an attribute
> Is it possible to match on elements where the names of the > elements to look > for are specified as the attribute values of other elements > ie. the element > name to match is specified at processing time? > > Consider the example source XML... > > <layout> > <layout_item data_element="item1"/> > <layout_item data_element="item2"/> > <layout_item data_element="item3"/> > </layout> > > <item1>I am item 1</item1> > <item2>I am item 2</item2> > <item3>I am item 3</item3> > You can do //*[name()=@data-element] But this is not a nice document design. Element tags are intended for identifying types, not instances. To identify instances, you should use an id attribute: <item id="item1"> Mike Kay 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
|

Cart








