| Newsgroups |
gmane.text.xml.xsl.general.mulberrytech |
| Message-ID |
<[email protected]> |
--_000_decf5721a92946ce9ae49fc237be69ecbaesystemscom_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
I am a Newbie and am having difficulties with an XSLT doing a lookup. I nee=
d to lookup up an old file number based off of an attribute, look at the lo=
okup file and pull in the new number. I am using Oxygen Editor version 22.1.
My XML file looks like this. I need to find the highlighted file in my look=
up and replace with the new file number.
<proc>
<title>FOLLOW-ON MAINTENANCE</title>
<step1 id=3D"M20340-03.01.01">
<para> Install access cover. <xref wpid=3D"M20236" pretext=3D"(" posttext=
=3D")"/>
</para>
</step1>
<step1 id=3D"M20340-03.01.02">
<para> Fill cooling system to proper fluid level. <xref wpid=3D"M20333" pre=
text=3D"(" posttext=3D")"/>
</para>
</step1>
My Lookup file looks like this (only added a few rows)
<row><NewFile id=3D"M20236">M20016-9-2350-372</Newfile></row>
<row><NewFile id=3D"M20234">M20381-9-2350-372</Newfile></row>
<row><NewFile id=3D"M20232">M20017-9-2350-372</Newfile></row>
This is my XSLT:
<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<xsl:stylesheet xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"
xmlns:xs=3D"http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes=3D"xs"
version=3D"2.0">
<xsl:output method=3D"xml" indent=3D"yes"/>
<xsl:include href=3D"copy.xsl"/>
<xsl:template match=3D"xref">
<xsl:variable name=3D"OLDFILE"><xsl:value-of select=3D"./@wpid"/></xsl:vari=
able>
<xsl:variable name=3D"NEWFILE">file:///C:/BAE/FAASV/OldnumberFAASV/Newfile_=
lookup.xml</xsl:variable>
<xref>
<xsl:attribute name=3D"wpid">
<xsl:choose>
<xsl:when test=3D"$OLDFILE =3D document($NEWFILE)//NewFile/@id">
<xsl:value-of select=3D"document($NEWFILE)//NewFile[@id=3D$OLDFILE]"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select=3D"."></xsl:copy-of>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xref>
Currently it is only returning the original value, not the new file number.
Thank you for any help,
Cathy Deiter
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/3329386
or by email: [email protected]
--~--
--_000_decf5721a92946ce9ae49fc237be69ecbaesystemscom_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii">
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Trebuchet MS";
panose-1:2 11 6 3 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"#0563C1" vlink=3D"#954F72">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Tr=
ebuchet MS",sans-serif;color:#333333;background:white">I am a Newbie a=
nd am having difficulties with an XSLT doing a lookup. I need to lookup up =
an old file number based off of an attribute,
look at the lookup file and pull in the new number. I am using Oxygen Edit=
or version 22.1.</span><span style=3D"font-size:10.0pt;font-family:"Tr=
ebuchet MS",sans-serif;color:#333333"><br>
<br>
<span style=3D"background:white">My XML file looks like this. I need to fin=
d the highlighted file in my lookup and replace with the new file number.</=
span><br>
<span style=3D"background:white"><proc></span><br>
<span style=3D"background:white"><title>FOLLOW-ON MAINTENANCE</tit=
le></span><br>
<span style=3D"background:white"><step1 id=3D"M20340-03.01.01"=
></span><br>
<span style=3D"background:white"><para> Install access cover. <xre=
f wpid=3D"<span style=3D"background:yellow;mso-highlight:yellow">M2023=
6</span>" pretext=3D"(" posttext=3D")"/></span>=
<br>
<span style=3D"background:white"></para></span><br>
<span style=3D"background:white"></step1></span><br>
<span style=3D"background:white"><step1 id=3D"M20340-03.01.02"=
></span><br>
<span style=3D"background:white"><para> Fill cooling system to proper=
fluid level. <xref wpid=3D"<span style=3D"background:yellow;mso-hi=
ghlight:yellow">M20333</span>" pretext=3D"(" posttext=3D&quo=
t;)"/></span><br>
<span style=3D"background:white"></para></span><br>
<span style=3D"background:white"></step1></span><br>
<br>
<span style=3D"background:white">My Lookup file looks like this (only added=
a few rows)</span><br>
<span style=3D"background:white"><row><NewFile id=3D"M20236&q=
uot;>M20016-9-2350-372</Newfile></row></span><br>
<span style=3D"background:white"><row><NewFile id=3D"M20234&q=
uot;>M20381-9-2350-372</Newfile></row></span><br>
<span style=3D"background:white"><row><NewFile id=3D"M20232&q=
uot;>M20017-9-2350-372</Newfile></row></span><br>
<br>
<span style=3D"background:white">This is my XSLT:</span><br>
<span style=3D"background:white"><?xml version=3D"1.0" encodin=
g=3D"UTF-8"?></span><br>
<span style=3D"background:white"><xsl:stylesheet xmlns:xsl=3D"</spa=
n></span><a href=3D"http://www.w3.org/1999/XSL/Transform"><span style=3D"fo=
nt-size:10.0pt;font-family:"Trebuchet MS",sans-serif;color:#368AD=
2;border:none windowtext 1.0pt;padding:0in;background:white;text-decoration=
:none">http://www.w3.org/1999/XSL/Transform</span></a><span style=3D"font-s=
ize:10.0pt;font-family:"Trebuchet MS",sans-serif;color:#333333;ba=
ckground:white">"</span><span style=3D"font-size:10.0pt;font-family:&q=
uot;Trebuchet MS",sans-serif;color:#333333"><br>
<span style=3D"background:white">xmlns:xs=3D"</span></span><a href=3D"=
http://www.w3.org/2001/XMLSchema"><span style=3D"font-size:10.0pt;font-fami=
ly:"Trebuchet MS",sans-serif;color:#368AD2;border:none windowtext=
1.0pt;padding:0in;background:white;text-decoration:none">http://www.w3.org=
/2001/XMLSchema</span></a><span style=3D"font-size:10.0pt;font-family:"=
;Trebuchet MS",sans-serif;color:#333333;background:white">"</span=
><span style=3D"font-size:10.0pt;font-family:"Trebuchet MS",sans-=
serif;color:#333333"><br>
<span style=3D"background:white">exclude-result-prefixes=3D"xs"</=
span><br>
<span style=3D"background:white">version=3D"2.0"></span><br>
<span style=3D"background:white"><xsl:output method=3D"xml" in=
dent=3D"yes"/></span><br>
<span style=3D"background:white"><xsl:include href=3D"copy.xsl"=
;/></span><br>
<br>
<span style=3D"background:white"><xsl:template match=3D"xref"&=
gt;</span><br>
<span style=3D"background:white"><xsl:variable name=3D"OLDFILE"=
;><xsl:value-of select=3D"./@wpid"/></xsl:variable>=
;</span><br>
<span style=3D"background:white"><xsl:variable name=3D"NEWFILE"=
;>file:///C:/BAE/FAASV/OldnumberFAASV/Newfile_lookup.xml</xsl:variabl=
e></span><br>
<span style=3D"background:white"><xref></span><br>
<span style=3D"background:white"><xsl:attribute name=3D"wpid"&=
gt;</span><br>
<span style=3D"background:white"><xsl:choose></span><br>
<span style=3D"background:white"><xsl:when test=3D"$OLDFILE =3D doc=
ument($NEWFILE)//NewFile/@id"></span><br>
<span style=3D"background:white"><xsl:value-of select=3D"document($=
NEWFILE)//NewFile[@id=3D$OLDFILE]"/></span><br>
<span style=3D"background:white"></xsl:when></span><br>
<span style=3D"background:white"><xsl:otherwise></span><br>
<span style=3D"background:white"><xsl:copy-of select=3D".">=
</xsl:copy-of></span><br>
<span style=3D"background:white"></xsl:otherwise></span><br>
<span style=3D"background:white"></xsl:choose></span><br>
<span style=3D"background:white"></xsl:attribute></span><br>
<span style=3D"background:white"></xref></span><br>
<span style=3D"background:white">Currently it is only returning the origina=
l value, not the new file number.<o:p></o:p></span></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Tr=
ebuchet MS",sans-serif;color:#333333;background:white">Thank you for a=
ny help,
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Tr=
ebuchet MS",sans-serif;color:#333333;background:white">Cathy Deiter</s=
pan><o:p></o:p></p>
</div>
</body>
</html>
<div><!-- begin bl.html.trailer -->
<div style=3D"border-top:1px solid black; background-color: #dddddd;
color: #888888; font-size: smaller; padding: 5px; text-align: center;
font-family: arial,verdana,arial,sans-serif; margin-top:1em; clear:
both; margin: auto">
<a href=3D"http://www.mulberrytech.com/xsl/xsl-list">
XSL-List info and archive</a>
<div style=3D"text-align:center;">
<a style=3D"color: blue;"
href=3D"http://lists.mulberrytech.com/unsub/xsl-list/3329386"
>EasyUnsubscribe</a>
(<a style=3D"color: blue;"
href=3D"mailto:[email protected]?subject=3Dremove"
>by email</a>)
</div>
</div>
<!-- end bl.html.trailer --></div>
--_000_decf5721a92946ce9ae49fc237be69ecbaesystemscom_--