xslt

removing the "T" from a datetime when doing a xml+xsl=html with .net (XmlDataDocument,XslCompiledTransform,XmlTextWriter)

what is the easiest way to remove the "T" from the result? I want the result to be "YYYY/MM/DD HH/MM/SS" the vb.net code is really straight forward xmlDoc = New Xml.XmlDataDocument(data_set) xslTran = New Xml.Xsl.XslCompiledTransform xslTran.Load(strXslFile) writer = New Xml.XmlTextWriter(strHtmlFile, S...

How do i transform a number to a repetition of characters in XSLT?

I have the following input: <node TEXT="txt"> <node TEXT="txt"> <node TEXT="txt"/> <node TEXT="txt"/> </node> <node TEXT="txt"/> </node> <node TEXT="txt"/> I am currently using: <xsl:number level="multiple" count="node" format="1"/> within an XSTL script to receive the following output: 1 txt 1.1 txt 1.1.1 txt 1.1.2 ...

How do i remove all linebreaks using XSLT?

I have something like this: <node TEXT=" txt A "/> <node TEXT=" txt X "/> <node> <html> <p> txt Y </p> </html> </node> <node TEXT="txt B"/> and i want to use XSLT to get this: txt A txt X txt Y txt B I want to strip all useless whitespaces and linebreaks of @TEXT's and CDATA's. The only XML-in...

Programatically opening an xml file in MS Word

I'm opening an xml file in Microsoft Word 2007 using C#. I'm using an xsl file to define the layout which worked up to the point that I needed to include an image. I used the typical src html tag and the image displays when the xml is viewed in ie but not when it's opened in Word. I get the image place holder so I can only assume Word si...

XSL element selection using variable

Basically I have a small template that looks like: <xsl:template name="templt"> <xsl:param name="filter" /> <xsl:variable name="numOrders" select="count(ORDERS/ORDER[$filter])" /> </xsl:template> And I'm trying to call it using <xsl:call-template name="templt"> <xsl:with-param name="filter" select="PRICE &lt; 15" /> </xsl...

Sorting in XSLT v1.0 to obtain the greatest value, a new question

I have an XML document with several <person> elements, each of which contains the <name> of the person, and several <preferred-number> elements inside a grouping <preferred-numbers> element. I already found that to obtain the greatest <preferred-number> I have to do an <xsl:apply-template> with a <xsl:sort> inside it and then take the ...

MSXML XSL Transformation mutithreaded performance contention

I have a multithreaded server C++ program that uses MSXML6 and continuously parses XML messages, then applies a prepared XSLT transform to produce text. I am running this on a server with 4 CPUs. Each thread is completely independent and uses its own transform object. There is no sharing of any COM objects among the threads. This works ...

Comparing 2 XML docs and applying the changes to source document

Here's my problem.I have 2 xmlfiles with identical structure, with the second xml containing only few node compared to first. File1 <root> <alpha>111</alpha> <beta>22</beta> <gamma></gamma> <delta></delta> </root> File2 <root> <beta>XX</beta> <delta>XX</delta> </root> This's what the result should loo...

XSLT, XPath and InStr

Is there a way to find a node matched on part of a value. If I have the following: <competition id="100" name="Barclays Premier League"/> <competition id="101" name="CocaCola Championship" /> <competition id="102" name="CocaCola League 1" /> Given the string "Premier League" or even "Prem", how would I match the correct node and get ...

node-set in xpath

Hello, everyone: I am writing a xslt style sheet to transform a xml to another xml. Here is the simplified version of original xml: <eml> <datatable> <physical> <distribution id="100"/> </physical> </datatable> <software> <implem...

Can't stop thinking about XSLT in procedural terms... help with apply-templates.

I know that XSLT does not work in procedural terms, but unfortunately I have been doing procedural languages for too long. Can anyone help me out by explaining in simple terms how things like apply-templates works and help a thicko like me to understand it. ...

XSLT Text Attribute as value for another element

With the XML below, I would like to know how to get the value of text in the case_id node as an attribute for the hidden input tag in the xsl sheet below. Is this possible? <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="data.xsl"?> <NewDataSet> <Cases> <Case> <case_id>30</case_id> ... ... </Case> </Cases> ...

Filter XML based on another xml using XSLT 1

How do we filter an xml document based on another xml document. I have to remove all the elements which are not there in the lookup xml. Both the input xml and lookup xml has the same root elements, we are using XSLT 1.0. Ex Input <Root> <E1 a="1">V1</E1> <E2>V2</E2> <E3>V3</E3> <E5> <SE51>SEV1</SE51> <SE...

Explicit script end tag always converted to self-closing

I'm using xslt to transform xml to an aspx file. In the xslt, I have a script tag to include a jquery.js file. To get it to work with IE, the script tag must have an explicit closing tag. For some reason, this doesn't work with xslt below. <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns="http://www.w3.org/...

xslt output html controls - dynamic control name

I'd like to output html controls using xslt, but I need to be able to name the controls so that I can get at them when the form posts back. I'd like to be able to name the radio button "action_" + _case_id. <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="data.xsl"?> <NewDataSet> <Cases> <Case> ...

Accessing same name elements for multiple sources using XSLT

I am parsing a document using XSLT. Within the XSLT I am loading a reference document using the document() function, and I can access items from both documents. Both the source document and the reference document have an attribute called name. How do I compare one to the other. I have got around this by declaring a variable, but I wo...

Merge XML nodes using XSLT

Is it possible to merge elements using XSLT. If I have the following XML <data> <item column="left" value="1" /> <item column="left" value="2" /> <item column="right" value="3" /> <item column="left" value="4" /> <item column="right" value="5" /> <item column="right" value="6" /> <item column="right" value="7" /> <item column="left" va...

xsl:for-each loop counter

How do I save the iterations that have occurred in an xsl:for-each? (variables in XSL are immutable) My goal is to find the MAX number of children for any node at a particular level. For example, I might want to print that there are no more than 2 Response nodes for any Question in this survey: <?xml version="1.0" encoding="ISO-8859-1...

How to flatten this XML with XSLT

INPUT <logs> <logentry revision="648"> <author>nshmyrev</author> <date>2008-09-21T19:43:10.819236Z</date> <paths> <path action="M">/trunk/po/ru.pi</path> </paths> <msg>2008-09-21 Nickolay V. Shmyrev [email protected] * ru.po: Updated Russian translation.</msg> </logentry> <logentry revision="647"> <author>ckirbach</author> <date>2...

Any good XSLT tutorial/book/blog/site online?

Any recommendations? ...