xslt

pull unique groups from xml using xslt

I realize you can't use arrays in xsl and normally to do the task below it would take an array. Here's what I need... Sample xml code... <products> <product> <productNumber>1</productNumber> <productType>TypeA</productType> </product> <product> <productNumber>2</productNumber> <productType>TypeB</productType> </product> <p...

XSLT with overlapping elements?

So the title of this post may be a little misleading, but it's the best I can come up with. I'm working on a project that uses TEI for encoding texts. One of the requirements of my current work is to write XSL transformations to render the XML-encoded texts as HTML. For the most part, no problem. I'm kind of stuck on this issue, thou...

Zip code is dropping leading zero when displayed on excel. Export to excel from vb.net XML to XSLT transform.

I am exporting data from vb.net to excel and it is dropping the leading zero when its displayed on excel. How can I avoid the dropping of leading zero? I read the solution of adding a single quote but it makes my excel sheet column ugly. Also users will complain if they see a single quote on zip code field. vb.net code Response.AddHea...

xslt unescape twice (e.g. &amp;amp; to become &)

I am trying to transform some xml, which was returned by the Twitter Search api. It looks like the content element contains text that is escaped twice, Inception style. When I use the following in my XSL stylesheet it only unescapes it once: <xsl:value-of select="atom:content" disable-output-escaping="yes" /> How do I perform the seco...

Need an XSLT 1.0 solution for what would be a relatively simple regular expression.

I've got a field in my xml that looks like this (some examples): <ViolationCharged>VTL0180 0D 0I0</ViolationCharged> <ViolationCharged>VTL0180-C 02A 0I0</ViolationCharged> <ViolationCharged>VTL1180 B 0I0</ViolationCharged> I need to turn it into something that looks like this: <Violation>VTL180.0D</Violation> <Vi...

xslt Parsing in .NET

Hi all, Consider following snippet code for xml. <rootnode> <child id="child1" ><![CDATA[child 1]]></child> <child id="child2" ><![CDATA[child 2]]></child> <child id="child3" ><![CDATA[child 3]]></child> <child id="child4" ><![CDATA[child 4]]></child> <child id="child5" ><![CDATA[child 5]]></child> <child id="chi...

" inside attribute in xslt

hi i am trying to write a regular expression inside an xslt but i have a problem with the " sign. i closes the attribute. and \" dosnt seem to work like it works in aspx pages here is my code: <xsl:if test="@text = 'yes'"> <asp:RegularExpressionValidator runat="server" ControlToValidate="{@name}" ValidationExpression="^[\w '%+*....

Environment for editing/testing XML,XSL files locally?

Hi all Just wondering if anybody knows of an environment for running, testing, debugging xml and xsl locally. Kind of like the way XAMPP can be used for web design. Any help is appreciated Thanks ...

Alphabet index template: "xsl:key" match problem.

XML: <?xml version="1.0" encoding="windows-1251"?> <mode> <term> <name>abhdk</name> </term> <term> <name>njhjsu</name> </term> <term> <name>sdasd</name> </term> <term> <name>vbvbcd</name> </term> ... </...

XSLT -> Blank xmlns="" after Transform

Hello, I'm using an XSLT to transform from one XML standard to another. The particular resulting XML standard contains a root element which is part of a namespace and a child node which is part of another namepsace. The transform successfully reflects these namespaces but the child's child now contains a blank xmlns attribute. How ca...

XSLT to output plain text table

I'm working on an XSL template to convert an XHTML/hResume document to plain text, and I'm having trouble with the table layout (no, not layout tables). At the moment I've got the following, using the excellent Dave Pawson's padding template: <variable name="newline" select="'&#10;'"/> <template match="xhtml:table"> <variable name="...

Limit sorted conditional xsl:for-each results to n values

Hi everyone, I looked around on the site but wasn't able to locate a solution to a particular XSL problem. If you recognize this as a duplicate post I apologize and would be thankful to be pointed in the right direction. Based on the relatively simple XML data set below I want to create a table by project but also limit the entries to ...

XSLT grouping continued - xPath issue??

Dimitre was a big help earlier... this is kinda like part two. :) I've been wracking my brain and still don't see it. Now that I'm able to isolate the Brands of the xml example below, now I'd like to isolate all the Product-Type's of the given $Brand in much the same way as I was able to isolate all the Brands. xml example (one member...

How to extract this format in xslt

Hi All, I have an xml structure: <Date>Mon, 11 Aug 2009 13:15:10 GMT</Date> i want to extract only 15:10 or '15' and '10'. What is the best way to do that using xslt ...

YQL XSLT implementation limitations

For some reason, YQL's XSLT table can't parse my stylesheet. I have used the stylesheet successfully with the W3C's XSLT service. Here's an example of the problem in YQL Console. Why does this not work in YQL? Also, I have yet to figure out how to pass the results of a YQL query to the XSLT table as the XML to be transformed while also ...

Is it possible to use the sprintf() function in XSLT?

I'd like to do something like "Hello %s" and have "World" in another variable. Of course I could do this simple case using string replacement but if possible I'd like all sprintf() features like argument reordering, which would be very complex to do myself. ...

Where can I find a good tutorial on XSLT files?

I'm writing a translation between two XML file types and was wondering where I could find some good tutorials about this process. Thanks. ...

How to extract this date format in xslt

Hi All, I have an xml structure: <Date>Mon, 11 Aug 2009 13:15:10 GMT</Date> i want to extract only 13:15 or '13' and '15'. What is the best way to do that using xslt ...

When is match-attribute of xsl:template applied? (and how can it be overridden)

As I have understood the match atribute of a template tag, it defines what part of the xml tree that will be enclosed in the template. However ther seem to be some exceptions, I have a working peace of code, lite this: <xsl:template match="/root/content"> <xsl:for-each select="/root/meta/errors/error"> <p> <str...

variable inside a variable in xslt coding

Is it possible to create a variable inside a variable in xslt?? Is the above thing possible??? ...