This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: queering data from another xml file
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] queering data from another xml file
- From: "Mitch C. Amiano" <Mitch dot Amiano at alcatel dot com>
- Date: Fri, 02 Nov 2001 14:35:17 -0500
- Organization: Alcatel
- References: <5B57189920E7D41190B500606D21068601153A7E@mailsvr.jfcom.mil>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Off the cuff, assuming something/@fileref,
<xsl:template match="something">
<xsl:variable name="ref" select="@fileref"/>
<xsl:variable name="mike"
select="document('ACAD.xml')/ACAD/Drawing[@generated=$ref]"/>
<xsl:choose>
<xsl:when test="$mike">
<xsl:value-of select="$mike/@autocad">
</xsl:when>
</xsl:choose>
</xsl:template>
"Douklias, Mike JSIMS_M" wrote:
>
> 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
>
> Here is the XSLT code:
>
> <xsl:template match="something">
> <xsl:variable name="mike"
> select="document(ACAD.xml')/ACAD/Drawing/@generated=@fileref"/>
> <xsl:choose>
> <xsl:when test="$mike">
> TRUE---Found a match!!!!!
> HOW CAN I GET THE @autocad???????
> </xsl:when>
> </xsl:choose>
> </xsl:template>
>
> <ACAD>
> <Drawing generated="ch300.JPG" autocad="BRL00203-Model.dwf"/>
> <Drawing generated="ch304.JPG" autocad="BRL00201-Model.dwf"/>
> </ACAD>
>
> Mike Douklias
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
--
Mitch.Amiano (@alcatel.com)
SW Development Engineer in C++/Java/Perl/TCL/SQL/XML/XSLT/XPath
Advance Design Process Group, Raleigh Engineering Services Alcatel
USA
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list