xslt

XSLT: Specific Element Always Added to root?

I have a situation where particular elements (xs:simpleType, xs:complexType) are placed in the output as they are encountered: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; <xs:complexType name="HighSchoolType"> <xs:sequence> <xs:element name="OrganizationName" type="core:OrganizationNameType"/> <xs:element name="OPE...

XSLT: Remove duplicate nodes based on name attribute

I have the following: <xs:schema> <xs:complexType name="NameType"> <xs:sequence> <xs:element name="NamePrefix" type="core:NamePrefixType" minOccurs="0"/> <xs:element name="FirstName" type="core:FirstNameType" minOccurs="0"/> <xs:element name="MiddleName" type="core:MiddleNameType" minOccurs="0" maxOccurs="10"/> <xs:element name...

Can I fake a namespace reference in XSLT

I have a xsl that i've copied out of Sharepoint, and pulled into visual studio. Visual studio will not compile or apply the transfromation because of this error XslTransformException --------------------- Cannot find the script or external object that implements prefix 'http://schemas.microsoft.com/WebParts/v2/DataView/runtime'. Can ...

Generate C# code for Oracle table

I have this XML for a table structure in Oracle (export option in PL/SQL developer). How can I generate code in C# for get entity class? <?xml version="1.0" encoding="utf-8"?> <ROWDATA> <ROW> <Name>ID_TRANSACCION</Name> <Type>NUMBER(12)</Type> <Nullable></Nullable> <Default></Default> <Comments>Identificador unico ...

Tricky XSLT recursive tree transformation

(Note: If you do well in a functional programming language other than XSLT, this problem might still be for you - it's not necessarily the XSLT that makes this tricky for me.) How would I transform this: <!-- note that empty cells are implicit and therefore nonexistent --> <tables> <table pos="1"> <row pos="1"> <cell pos="1...

XSLT: Conditional attribute Value handling

The following isn't working as intended: <xsl:template match="xs:complexType"> <xsl:param name="prefix" /> <xsl:if test="$prefix='core'"> <xsl:variable name="prefix" select=""/> </xsl:if> <xs:complexType name="{concat($prefix, @name)}"> <xsl:apply-templates select="node()" /> </xs:complexType> <xsl:apply-templates ...

How to select these elements with Xpath?

I have a document, something like this: <root> <A node="1"/> <B node="2"/> <A node="3"/> <A node="4"/> <B node="5"/> <B node="6"/> <A node="7"/> <A node="8"/> <B node="9"/> </root> Using xpath, How can I select all B elements that consecutively follow a given A element? It's something like following-silbi...

XSLT Append to Result Document

Hi, I have an XSLT script that I use for code generation where I process multiple input XML files, and output the files to Javascript code. For each xml input file, I output one Javascript file. So, I would have the following files/transformations occuring: view1.xml -> view1.js view2.xml -> view2.js ... Now I have a requirement ...

Remove last characters in a XSLT string

Hi there I have an issue about XSLT. In my CMS it is posible to create a new article, and choose an image to be shown on that article. When an image is choosen, there will automatically be created a thumbnail of the image as well. If we say that the uploaded image is called: image.jpg then the thumbnail will automatically be named imag...

XSLT: Test Parameter to know if it has been set

I have a situation where the param won't be set, but my attempts to capture & handle the sitation aren't working. I'm using the following: <xsl:template match="xs:complexType"> <xsl:param name="prefix" /> <xsl:variable name="prefix-no-core"> <xsl:choose> <!-- if no value, default to 'AcRec' --> <xsl:when test="no...

XSLT question. How to pair field tags with data when original XML has them in separate sections?

I hope I don't lose anyone by mentioning Filemaker. I am trying to turn it's XML export into something usable by SSIS. FM's native XML export has field names and data in separate sections of the same XML file. This lists what I need it to do, what I currently did, and the original FM export at the bottom for reference. I have not see...

Using XSLT to output multiple files

I'm trying to get an example that I found for using XSLT 2.0 to output multiple files working. Using Saxon B 9.7.0.1 with Java 1.6, I get this error: C:\Documents and Settings\Administrator\Desktop\saxon>java -jar saxon9.jar -s:input.xml -xsl:transform.xml Error on line 15 of transform.xml: java.net.URISyntaxException: Illegal charac...

Why does XSLT seem to irritate so many people?

What it is about XSLT that people find irritating? Is it the syntax (which is pretty unusual) or just the way XSLT works in general? Are there features that are lacking? I did a little bit of XSLT (around 800 lines) a while ago and found it not that bad. So why the general animosity against it? ...

Which XSLT profiler should I use?

I'm in the market for an XSLT profiler. I'm using the Xalan-j XSLT processor from Apache. I'd like to be able to run the profiler under Windows or Linux as we have different teams using the same XML and XSLT on different platforms. The tool needs to be able to work with exslt extensions. The tool needs to be able to work with l...

XSLT and XML Question

I have this kinda interesting requirement. Typically you use XSLT to transform an XML document. The transformed HTML is viewable in a web browser, this works just great. I am also guessing the browser handles the transformation in memory, because if you view the page source of an xml document with XSLT, you don't see html, only xml. ...

In Eclipse 3.5 : Rewrite xsl import/include location behind the scenes so it will properly validate files

I'm using Ubuntu I'm working with xsl files that have import or include statements like this <xsl:import href="/xsl/content/contentsecondary.xsl" /> Eclipse can't find this file because the /xsl/ isn't actually at the the root of the project, but is seen from the root of the web server because of this line in my etc/xml/catalog file:...

JDeveloper Syntax Highlighting of XSL files

I would a way to do javascript call syntaxt highlighting in XSL files as well as HTML. Turn the text green or something. ...

XSLT "contains" function to check for period

Ok, I'm stumped. I would like test if a parameter sent to an XSLT template contains a period and to print out quotes if it does not. The parameter I would like to test is "value" in the template below. It seems the contains function should work, but for some reason the quotes always get outputted regardless the contents of "value". Wh...

Recusive transformations using xslt, xpath:document() and mediawiki

I want to use the wikipedia API to find the French pages including the ''Template:Infobox Scientifique'' missing in the english version. So, my idea was to process the following document with xproc: http://fr.wikipedia.org/w/api.php?action=query&amp;format=xml&amp;list=embeddedin&amp;eititle=Template:Infobox%20Scientifique&amp;eilimit=...

XSLT: xsl:function won't work

The following works for me: <xsl:variable name="core" select="document('CoreMain_v1.4.0.xsd')" /> <xsl:variable name="AcRec" select="document('AcademicRecord_v1.3.0.xsd')" /> <xsl:template match="xs:element"> <xsl:variable name="prefix" select="substring-before(@type, ':')" /> <xsl:variable name="name" select="substring-after(@...