ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> visual-xslt-discuss
visual-xslt-discuss
[Visual-XSLT-discuss] XPath Workshop and XML namespaces
by Jerry Collings other posts by this author
Jul 23 2004 5:25PM messages near this date
view in the new Beta List Site
[Visual-XSLT-discuss] No stylesheet was loaded. | [Visual-XSLT-discuss] help needed
This is a multi-part message in MIME format.

------_=_NextPart_001_01C470DA.195CC0A1
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I'm having trouble setting my context node to a node from a different =
namespace.
Is there a way to do this?
=20
Example XML:
<a1 xmlns=3D"namespaceA" xmlns:A=3D"namespaceA" xmlns:B=3D"namespaceB"> 
   <a2> 
      <b1 xmlns=3D"namespaceB"> 
         <b2> some text</b2>
      </b1> 
   </a2> 
</a1> 
=20
I want my context to be at <b1> .
The namespace qualified xpath from root to <b1>  is =
"/A:a1[1]/A:a2[1]/B:b1[1]", however the XPath workshop generates the =
context node as "/a1[1]/a2[1]/b1[1]" when I try navigating there.
This does not work and so my context is always reset to "/"
=20
Jerry Collings

------_=_NextPart_001_01C470DA.195CC0A1
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
<HTML> <HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1"> 


<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR> </HEAD>
<BODY> 
<DIV> <SPAN class=3D088531317-23072004><FONT face=3DArial size=3D2>I'm =
having trouble=20
setting my context node to a node from a different=20
namespace.</FONT> </SPAN></DIV>
<DIV> <SPAN class=3D088531317-23072004><FONT face=3DArial size=3D2>Is =
there a way to do=20
this?</FONT> </SPAN></DIV>
<DIV> <SPAN class=3D088531317-23072004><FONT face=3DArial=20
size=3D2> </FONT></SPAN>&nbsp;</DIV>
<DIV> <SPAN class=3D088531317-23072004><FONT face=3DArial =
size=3D2> Example=20
XML:</FONT> </SPAN></DIV>
<DIV> <SPAN class=3D088531317-23072004><FONT face=3DArial size=3D2>&lt;a1 =

xmlns=3D"namespaceA" xmlns:A=3D"namespaceA"=20
xmlns:B=3D"namespaceB"&gt;</FONT> </SPAN></DIV>
<DIV> <SPAN class=3D088531317-23072004><FONT face=3DArial =
size=3D2> &nbsp;&nbsp;=20
&lt;a2&gt;</FONT> </SPAN></DIV>
<DIV> <SPAN class=3D088531317-23072004><FONT face=3DArial=20
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;b1=20
xmlns=3D"namespaceB"&gt;</FONT> </SPAN></DIV>
<DIV> <SPAN class=3D088531317-23072004></SPAN><SPAN =
class=3D088531317-23072004> <FONT=20
face=3DArial size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;b2&gt;some text&lt;/b2&gt;</FONT> </SPAN></DIV>
<DIV> <SPAN class=3D088531317-23072004><FONT face=3DArial=20
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/b1&gt;</FONT></SPAN></DIV>
<DIV> <SPAN class=3D088531317-23072004><FONT face=3DArial =
size=3D2> &nbsp;&nbsp;=20
&lt;/a2&gt;</FONT> </SPAN></DIV>
<DIV> <SPAN class=3D088531317-23072004><FONT face=3DArial=20
size=3D2> &lt;/a1&gt;</FONT></SPAN></DIV>
<DIV> <SPAN class=3D088531317-23072004><FONT face=3DArial=20
size=3D2> </FONT></SPAN>&nbsp;</DIV>
<DIV> <SPAN class=3D088531317-23072004><FONT face=3DArial size=3D2>I want =
my context to=20
be at &lt;b1&gt;.</FONT> </SPAN></DIV>
<DIV> <SPAN class=3D088531317-23072004><FONT face=3DArial size=3D2>The =
namespace=20
qualified xpath from root to &lt;b1&gt; is "/A:a1[1]/A:a2[1]/B:b1[1]", =
however=20
the XPath workshop generates the context node as "/a1[1]/a2[1]/b1[1]" =
when I try=20
navigating there.</FONT> </SPAN></DIV>
<DIV> <SPAN class=3D088531317-23072004><FONT face=3DArial size=3D2>This =
does not work=20
and so my context is always reset to "/"</FONT> </SPAN></DIV>
<DIV> <SPAN class=3D088531317-23072004><FONT face=3DArial=20
size=3D2> </FONT></SPAN>&nbsp;</DIV>
<DIV> <SPAN class=3D088531317-23072004><FONT face=3DArial size=3D2>Jerry=20
Collings</FONT> </SPAN></DIV></BODY></HTML>

------_=_NextPart_001_01C470DA.195CC0A1--
Attachments:
unknown1


Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved