I'm having trouble using the document() function in my XSLT file. Here is the code:
<xsl:variable name="field_definitions" select="document('c:/temp/xmltest/field_definitions_nsf.xml')/records"/>
This works with Saxon if I use the command line processor, but I'm trying to do it from .Net and it's throwing this error:
An unhandled exception of type 'java.net.MalformedURLException' occurred in ikvm.gnu.classpath.dll
Additional information: Absolute URL required with null context
I've tried several different ways of referencing my xml document including, http://localhost/filename.xml, also: file://c:/temp/xmltest/filename.xml
Both of those work from the Saxon command line but again, not from within Saxon.net.
Can someone please help me?
we're working on the problem to find a solution for you. I have forwarded your question to our lead developer M. David Peterson who does the job of building the Saxon.NET dll, and can handle your question directly at the code level.
Try one more thing:
Adding the third "/" should invoke proper recoginition and this should fix things. If it does not let me know and I will dig deeper.
thanks David. That was it.
I have another question though, regarding carriage retruns.
In my original xslt stylesheet, i used the command:
to start a new line. This worked fine when running Saxon from the command line but now I am trying to use it from a VB.net application and everything is appearing on one big long line.
I've tried the following: " " , "
" , "
" ... and all combonation
I see in the C# example it is searching through the ByteArray output and replacing "\u000A" with "\r\n"
I tried including this into my VB.Net application (even tried vbCrLf instead of \r\n) but I can't seem to get any kind of carriage return to persist.
Thanks in advance,
if you want I can have a look at it; please send the project code in a zip to email@example.com.
I figured it out. I found out that even with VB.Net you still need ASCII codes 13 + 10 for line breaks. Apparently the rest of the modern world just uses ASCII 10. I think if something only needs code 10 then it will ignore the extra 13 so this should be fairly portable now.
My working code ended up being this:
Thanks to all that helped.
Log in to post a comment.