xslt

XSLT: trying to do a contains() with a full XPath. Why does this fail?

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; <xsl:output method="xml" encoding="utf-8" /> <xsl:template match="/"> <html> <body> <span> <div style="background-color:#000066;color:#EEEEEE;padding:7px"> <a name="top" style="padding-left:10px;font-size:28pt">A...

Multiple imports in XSLT

In my assignment, I have to import many XSLT in a single xslt. For example, <Globalxslt> <call XSLT1/> <call XSLT2/> <call XSLT3/> <call XSLT4/> </Globalxslt> I tried using <xsl:import href=”URI”/> and <xsl:include href=”URI”/> but I can import one of the xslt only and could not import the rest of the xslt. ...

Altova Mapforce: Can it create all elements in the output XSD?

Good Afternoon Developers, Just a quick question (I hope!) I am creating an XSLT file through Altova Mapforce and I was wondering if anyone knows whether it is possible to specify that the XSLT stipulates to create all elements and nodes in the Output XSD file even if there is no Input stipulated from the Input XSD? I know that I can ...

XslCompiledTransform causes grief with Infopath

I am not an infopath developer and this is my first real encounter with XSLT. Lately i've had to work on a project where i need to convert an infopath form uploaded to Sharepoint into html. Once in html we can use any thirdparty library to spit out any desired/supported format we want. What We Do In Code: We create an XslCompiledTrans...

Infopath Master Detail Section Lost after XslCompiledTransform

We have a web application which parses Infopath Xml forms hosted in Sharepoint environment and converts them to Html. We then convert to any desirable format using other third party libraries. I acquire the XmlDocument from sharepoint but when i Transform it using the XslCompiledTransform object I loose the Master/Details Section from ...

XSLT - Select only one set of data

Need some help: I want to only pull back the results for a specific ItemId, so if i wanted the only data for ItemId how could I adapt the template below? I've tried for about 2 hours without any luck... Here is a sample of my XML: ...

msxml fails to correctly close <link> tags during XSLT transformation

Hi, I'm trying to parse a RSS feed using C#, and I need to transform it with XSLT. Here's a snippet of my XSLT: <xsl:output encoding="UTF-8" method="html" omit-xml-declaration="yes"/> <xsl:template match="/"> <xsl:apply-templates select="rss/channel/item" /> </xsl:template> <xsl:template match="rss/channel/item"> <item> <li...

XSLT - Grouping same items

I have the following XML: <Info> <Name>Dan</Name> <Age>24</Age> </Info> <Info> <Name>Tom</Name> <Age>15</Age> </Info> <Info> <Name>Dan</Name> <Age>24</Age> </Info> <Info> <Name>James</Name> <Age>18</Age> </Info> And I need to produce the following HTML: <ul class="data"> <li>Dan</li> <l...

XSL Count Nodes From Root

My XML is completely recursive in that every element within it is an "Item" and the type is delineated by a "type" property. In my XSL I want to be able to determine what level of iteration I am at, or in other words, how many levels from the root I am currently. I can't figure out how to do this . . . XML Sample: <Questionnaire> <...

Get value once that occurs > once but siblings multiple times

The XSLT needs to output something like: Mathematics ID ID ID PSE ID I currently get: MathematicsID ID ID PSEID It seems that when it gets the <Subject> it also gets all the other elements, in this case ID where i want it to get the <Subject> then collect the relevant ID'. Here is my XML: <ArrayOfSchoolClass> <Schoo...

Printing one letter caption only once and matching items alphabetically

Hi, I know I can read a file into a variable like this: <xsl:variable name="content" select="document('file.xml')"/>, but how can I do the following: file.xml: <root> <child>Some</child> <child>Random</child> <child>Data</child> <child>Stuff</child> </root> Using that xml file, I'd like to print: D * Data R * Random S...

XSL: How do I assign the value of an XML element to a variable (minimal change to page below)?

See http://stackoverflow.com/questions/1468522/xslt-to-operate-on-element-value-before-displaying for the original XML and XSL. I got an answer to my question there. My other question on this same XML/XSL is: if I would like to capture the value of an element (such as the "title" element) in an XSL local variable, and then operate on it...

Dataview web part fails after minor changes.

We're working with a sharepoint 2007 site that has a number of dataview webparts showing different views of a document repositry. Each time we make even the most minor change (such as changing the chrome settings or adding a class) to the XSLT or webpart settings the DV webpart refuses to render. Our XSL is vaild, as is the page the GU...

view the html source of an xml document transformed by xsl

Hi guys, This is a fairly simple case. I have an xml document, linked to an xsl stylesheet, that can be viewed in a web browser. Now that the output is not really what I expected, so I want to look at the (output) html code to see what happened. However, when I say "view source", the browsers just throw the original xml file at me. Pleas...

Using PHP within XSL

Is it possible to use PHP within an XSL document? Always when I try to do so I get errors... so before freaking out I'd like to know whether or not it's even possible. (I am an absolute beginner) ...

Is there an Alternative to XSLT

is there anything that competes with XSLT. I really just cannot wrap my head around XSLT. ...

Is there an efficient way to turn LINQ-to-SQL data into XML?

Hey Everyone, I'm looking at building a templating engine for my website. I'm using ASP.NET MVC and Linq-to-SQL. So, What I'm wanting to do is generate an XML document like this: <?xml version="1.0" encoding="utf-8" ?> <MainPage> <MainPageHtml><![CDATA[<p>lol!</p><br/>wtf? totally!]]></MainPageHtml> <Roles> <Role RoleId="1">...

Apply XSL to External XML

Currently I use: <?xml-stylesheet type="text/xsl" href="XSL.xsl"?> To link XSL to XML. If my xml was here: www.externaldomain.com/rss.xml (Outside of my domain) how can i get the XSL linked to the XML? Can i point the XSL to a File or Link? ...

Different way of sorting a list, depending on a variable in XSLT

I am making a newslist, and have until now sorted the news after their date. Newest first. But I would like to give the administrator of the site a more flexible solution. This means that in the backend, the admin can choose from a dropdown-list, in wich way he/she want's the list to be sorted. By date(newest first and oldest first), o...

XSl:Variable - Condition to check whether value exist

Using XSLT 1.0, how do I check whether the value in the variable exists or not? I am assigning the value to the variable initially from my XML data and then need to check whether it exits or not: <xsl:variable name="DOC_TYPE"> <xsl:value-of select="name(./RootTag/*[1])"/> </xsl:variable> <xsl:if test="string($DOC_TYPE) = ''"> <xs...