|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: queering data from another xml file
> What I'm trying to do here is. While processing an XML file (MAIN.xml)
with
> XSL I need to pull data from another XML file (ACAD.xml) that depends on
> content.
>
> @fileref is an attribute in the MAIN.xml file
> @generated and @autocad attributes are in the ACAD.xml file
>
> if @fileref exists in the ACAD.xml I need to pull and use the @autocad
> attribute
if you change:
document('ACAD.xml')/ACAD/Drawing/@generated=@fileref
to:
document('ACAD.xml')/ACAD/Drawing[@generated=@fileref]
then the following will select the attribute:
select="$mike/@autocad"
or you could leave the variable alone, and just do the following:
select="$mike/../@autocad"
Which you do depends on your preference, I suppose. I'd prefer the first,
as a matter of style, but I suppose it depends on what you're going to do
with the variable.
If there's only one condition for the xsl:choose, and you won't use the
variable again, why not select the autocad attribute directly:
document('ACAD.xml')/ACAD/Drawing[@generated=@fileref]/@autocad
Hope that helps...
Dave
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








