RE: [xsl] question on paths

Subject: RE: [xsl] question on paths
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 26 May 2010 23:28:08 +0100
> So I am using the function below and get an error on the line:
>             <xsl: 
> select="/n1:recordDocument/n1:recordTarget/n1:patientRole"/>

Well, that's not even valid XML. Did you mean <xsl:sequence
select="/n1:recordDocument/....."? In that case you would get an error
saying there is no context node defined.

> However if I use:
>             <xsl: variable name="patientRole"
> select="/n1:recordDocument/n1:recordTarget/n1:patientRole"/>
> It is valid but do not return the path.

That should give the same error relating to the context node (I assume the
space in "xsl: variable" is a typo).
> 
> Of course this is valid as well:
>             <xsl:value-of
> select="/n1:recordDocument/n1:recordTarget/n1:patientRole"/>
> But not what I need...

I'm afraid you haven't made it at all clear what you are trying to achieve.

> Also I am running it from Ant 1.7 using Saxon Ant jar. is 
> there any way to make errors more descriptive?

You haven't said what error message you got. Perhaps you simply don't
understand the terminology that's it's using, in which case we can explain
it to you. Designing error messages is a tricky art: you have to use correct
terminology to avoid confusing people who know the correct terminology, but
you don't want to make it totally incomprehensible to beginners who don't
understand the terminology yet.

> Or is it a matter of the library - in this case Saxon?
> Also any recommendations on Saxon vs Xalan 

You're using xsl:function, which requires XSLT 2.0, so Xalan is not an
option.

Regards,

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

Current Thread