[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Antw: Re: join two files - plz help

Subject: RE: Antw: Re: join two files - plz help
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 20 Jun 2005 14:41:46 +0100
join xml files
> Whats's wrong here?
> 
>  
> <xsl:template match="/SymCLI_ML/Symmetrix/Device">
> <xsl:for-each
>
select="document('lspv_lirp33.xml')/Front_End/Port[@pd_name=current()/@pd_na
me]/@aix_vg">

Here current() is a Device, and your Device element doesn't have an @pd_name
attribute.

Michael Kay
http://www.saxonica.com/


>  
> > 
> > Here is an excerpt of the first XML-File, there is an object called
> > ".../Device/Front_End/Port/@pd_name" inside:
> > 
> > <?xml version="1.0" standalone="yes" ?>
> > 
> > <SymCLI_ML>
> > <Symmetrix id="000287970171">
> > <Device dev_name="0007" status="Ready" configuration="2-Way Mir">
> > <Flags worm_protected="False" grouped="False" meta="None"/>
> > <Capacity megabytes="3"/>
> > <Front_End>
> > <Port pd_name="/dev/rhdiskpower0" director="02C" port="0"/>
> > </Front_End>
> > <Back_End>
> > <Disk director="16A" interface="C" tid="3"/>
> > </Back_End>
> > </Device>
> > <Device dev_name="0008" status="Ready" configuration="2-Way Mir">
> > <Flags worm_protected="False" grouped="False" meta="None"/>
> > <Capacity megabytes="3"/>
> > <Front_End>
> > <Port pd_name="/dev/rhdiskpower1" director="02C" port="0"/>
> > </Front_End>
> > <Back_End>
> > <Disk director="01B" interface="C" tid="3"/>
> > </Back_End>
> > </Device>
> > ...
> > 
> > With Unix-Shell (on AIX 5.3) i have generated an XML-File with the
> > Output of the AIX-Command lspv (list physical volumes). The content
> of
> > this valid xml-file looks like this: 
> > 
> > <?xml version="1.0" standalone="yes" ?>
> > <SymCLI_ML>
> > <Symmetrix id="000287970171">
> > <Device>
> > <Front_End>
> >    <Port pd_name="/dev/rhdiskpower49" aix_vg="oraclevg">
> >    </Port>
> >    <Port pd_name="/dev/rhdisk0" aix_vg="rootvg">
> >    </Port>
> >    <Port pd_name="/dev/rhdisk1" aix_vg="rootvg">
> >    </Port>
> >    <Port pd_name="/dev/rhdiskpower4" aix_vg="oraclevg">
> >    </Port>
> >    <Port pd_name="/dev/rhdiskpower5" aix_vg="tsmvg">
> >    </Port>
> >    <Port pd_name="/dev/rhdiskpower6" aix_vg="tsmvg">
> > 
> > ...
> > 
> > You see, in both files there are entries called "pd_name". Plz.
> could
> > you tell me how to join these two files? I need a report that shows
> at
> > least every "dev_name" and "*hdiskpower*" in the first mentioned
> sample
> > with the correct "aix_vg" in the second snippet. I have already read
> > many examples, but i can't make the grade. Any hint would be
> > appreciated.
> 
> You need to use the document function. See:
> 
> http://www.w3.org/TR/xslt#function-document 
> 
> What you'll want is something like this:
> 
> document("foo.xml")//Port[@pd_name=current()/@pd_name]/@aix_vg
> 
> sdc
> 
> > Thanks in advance
> > ::mike

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.