Project

Profile

Help

document('') to refer to the XSL transform

Added by Anonymous over 16 years ago

Legacy ID: #4862906 Legacy Poster: brook (mootkat)

I've got some XSLT 1 transforms that use embedded lookups for data normalization. I access those nodes like this: document('')/xsl:stylesheet/node/subnode This has worked well in Saxon 6.5, Saxon 8, Xalan, and XSLTC. In Saxon 9, it doesn't return a node match. count(document('')) returns 0. I'm sure I could get around this by putting the lookups in an external XML file, but I like the simplicity of having it self-contained.


Replies (2)

RE: document('') to refer to the XSL transfor - Added by Anonymous over 16 years ago

Legacy ID: #4863176 Legacy Poster: Michael Kay (mhkay)

There's no reason why this shouldn't work in Saxon 9. The most likely explanation is that you are failing to set the base URI correctly. How are you running the transformation?

RE: document('') to refer to the XSL transfor - Added by Anonymous over 16 years ago

Legacy ID: #4868398 Legacy Poster: brook (mootkat)

I haven't had a chance to dig into this in detail, but I've just discovered a case in which it is working as expected. The environment I'm working in has been set up by another team, which makes it kind of hard for me to know what's going on, but all they did was switch JAXP from calling Xalan to calling Saxon, at which point some of the previous document('') calls started to return nothing. When I put the lookup info in an external file in the same directory, it's found. If I have more time to look at it later and see what the differences between the cases that are working and the ones that aren't are, I will, but I'm under a tight time constraint, so for now I have to choose workaround over troubleshooting.

    (1-2/2)

    Please register to reply