Random photo
Loading...
Domains for sale
|
February 21, 2004nxslt.exe Command Line UtilityFebruary 21, 2004 1:09 AM
| #XML in .NET
Comments
Thanks for you comments, Drazen! I've fixed namespace declaration bug you mention, thanks! New nxslt home is at http://www.xmllab.net. There you can download new 1.6 version. Posted by: Oleg Tkachenko at June 30, 2005 2:48 PMBefore I start listing bugs/problems, let me thank you for the work you've done. Very nice utility with a complete yet not overloaded feature set. Sure you can. Technically speaking XSLT accepts multiple inputs and all input documents are equivalent, it's just one of them - source - is implicit. It's good practice always to apply templates to root element then: Thanks again Oleg. Last question - can I apply my stylesheet (XSLT) to the document included using the document() function, and will it handle any recurrsion? Posted by: David at May 29, 2005 7:47 AMDavid, sure it can. It's perectly valid to build URL dynamically and pass it to document() function. The only limitation - document() funcion can only load XML documents, not plain text. Posted by: Oleg Tkachenko at May 27, 2005 10:02 PMThanks Oleg. Will try this. I should have pointed out, the full URL of the object I need to retrieve is not part of the XML input stream - I am creating the URL from an attribute.......can the document function use xsl:variables ? Posted by: David at May 27, 2005 8:04 PMnxslt tool applies XInclude during parsing of source XML and XSLT stylesheet documents, not during output phase. Basically to dynamically include XML document in XSLT you don't need XInclude. Just use document() function: <xsl:copy-of select="document(@your_attribute)"/> Or even <xsl:apply-templates select="document(@your_attribute)/*"/> Posted by: Oleg Tkachenko at May 25, 2005 6:25 PMHi, What order does processing occur in -> XML->XSLT->OUTPUT->XINCLUDES or XML->XSLT->XINCLUDE->OUTPUT ? I'm trying to dynamically create the XINCLUDE from an attribute on a node Can Xincludes be dynamically generated from content and then resolved? The objective is to retrieve an XML document denoted by the attribute in the XML stream and incorporate into the output. Thanks - David Michael, here is a sample: nxslt.exe source.xml style.xsl -ext user:My.Extensions xmlns:user="http://www.user.com" -af d:\temp\extensions.dll This binds My.Extensions class from d:\temp\extensions.dll to user namespace prefix. In XSLT you have to declare user namespace and then you can call My.Extensions class methods using user:Function() syntax. Posted by: Oleg Tkachenko at April 20, 2005 1:31 PMHow do I bind a class in a C# class library DLL to an extension object namespace? Posted by: Michael S. Scherotter at April 19, 2005 9:46 PMOrlando, .NET XSLT Processor - XslTransform class doesn't support that. Hi, This what I have in my xsl, what am I doing wrong? <?xml version="1.0" encoding="ISO-8859-1"?> Hey, that's good idea, Devo! I'll check it out. Posted by: Oleg Tkachenko at April 12, 2005 12:06 PMhi oleg, Are in your plans, create a nant contrib task with this nice tool ? Nice work, very handy. Thanks! Posted by: Jason Mauer at April 9, 2005 11:15 PMTim, this is called an intra-document reference in XInclude. Never heard. Go ahead if you think it's gonna be useful. Posted by: Oleg Tkachenko at February 13, 2005 1:00 PMthanks. cool stuff. i might want to port this to java 1.5. do you know if someone tried it ? Thank you, BR,
<xsl:output method = "xml" version = "4.0" encoding="ASCII" indent = "yes" /> <!-- Identity template --> <!-- This template strips out elements with the XInclude namespace. You would use this as a pre-processing step if you're going to xinclude parts of a document in itself, to avoid circular references. --> </xsl:stylesheet> Posted by: Tim at December 22, 2004 7:52 PMmike, nxslt.exe is basically XSLT utility and it does require stylesheet. In the meantime you can provide dummy stylesheet, which does nothing : <xsl:stylesheet version="1.0" I was trying to use nxslt.exe to resolve some xinclude statments in a xml file to create a new xml file without the xincludes. It bombed because it didn't provide an stylesheet filename, but temp.xml uses no stylesheet. I just want out.xml to have all the replacements of xi:include for the acutal xml files in the includes. How can I do this? thanks, mike Posted by: mike at November 29, 2004 7:55 PMhi oleg, wanted to send you an error report with a 20kb attachment. but both mail addrs (oleg@tkachenko.com + olegt@multiconn.com) bounced: No Storage Space pls let me know when/where to I can resend ... TIA, andreas Posted by: andreas at June 2, 2004 12:05 PMEr ... never mind. :-) I wish I'd tried it before I posted, but this format: works fine for me. I think my previous example was a bad format I was using due to my newbie status with XSLT. Thanks! I'm really frustrated with myself for not being able to figure this out, but I'll be derned if I can get a simple format-date call working. Here's the error I get when I run nxslt.exe from the command line: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Xml.Xsl.XsltException: The named template 'http://exslt.org/dates-and-times:format-date' does not exist. Here's a snippet of my transformation sheet: ...
In case you have a chance to look at it, I've uploaded the complete files here: http://scottclan.cc/misc/using_nxslt.zip Thanks, Well, nxslt.exe itself isn't XSLT processor, it's just a handy wrapper around standard .NET System.Xml.Xsl.XslTransform class. I've just tried using this utility to convert WordML to HTML using the stylesheet you provided. Thank you very much for this. However, I've noticed a problem in transforming another stylesheet I was using previously. I setup a variable I want to use for making comparisons to: <xsl:variable name="Contact" select="/PPMDoc/Template/Query/QueryCriteria/ClinicianOrNurse"/> and later get a count of records matching this variable: <xsl:value-of select="count(Patients/Patient/OutPatients/OutPatient[1][eo_DiscussedWith=$Contact])"/> Previously, using MSXML v4, I'd get the correct count of records matching (say count=30), but using your utility to perform the transformation, I always get 0 matches. Do you know why this might be? Thanks again. Posted by: Colin at March 31, 2004 2:52 PMPost a comment
Listed below are links to weblogs that reference this post:
Israeli .Net Bloggers from ISerializable |