Search Results

Search found 39 results on 2 pages for 'saxon'.

Page 1/2 | 1 2  | Next Page >

  • Set saxon DocumentBuilderFactoryImpl features using javax.xml interface.

    - by Mycol
    Here what I have. System.setProperty( "javax.xml.parsers.DocumentBuilderFactory", "net.sf.saxon.dom.DocumentBuilderFactoryImpl"); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); //factory.setNamespaceAware(true); //factory.setIgnoringElementContentWhitespace(true); //factory.setValidating(false); //factory.setIgnoringComments(true); DocumentBuilder builder = factory.newDocumentBuilder(); Document xml = builder.parse(file.getAbsolutePath()); Saxon parser doesn't allow me to set the commentet properties: javax.xml.parsers.ParserConfigurationException: Saxon parser does not allow whitespace in element content to be ignored at net.sf.saxon.dom.DocumentBuilderFactoryImpl.newDocumentBuilder(DocumentBuilderFactoryImpl.java:98) I thought i could set those features in other way, like factory.setAttribute(string, bool) factory.setFeature(string, bool) But I can't find anywhere the values for "string". I tried net.sf.saxon.FeatureKeys whitout success. My question is: what's the correct way to do that?

    Read the article

  • Difficulty getting Saxon into XQuery mode instead of XSLT

    - by Rosarch
    I'm having difficulty getting XQuery to work. I downloaded Saxon-HE 9.2. It seems to only want to work with XSLT. When I type: java -jar saxon9he.jar I get back usage information for XSLT. When I use the command syntax for XQuery, it doesn't recognize the parameters (like -q), and gives XSLT usage information. Here are some command line interactions: >java -jar saxon9he.jar No source file name Saxon-HE 9.2.0.6J from Saxonica Usage: see http://www.saxonica.com/documentation/using-xsl/commandline.html Options: -a Use xml-stylesheet PI, not -xsl argument -c:filename Use compiled stylesheet from file -config:filename Use configuration file -cr:classname Use collection URI resolver class -dtd:on|off Validate using DTD -expand:on|off Expand defaults defined in schema/DTD -explain[:filename] Display compiled expression tree -ext:on|off Allow|Disallow external Java functions -im:modename Initial mode -ief:class;class;... List of integrated extension functions -it:template Initial template -l:on|off Line numbering for source document -m:classname Use message receiver class -now:dateTime Set currentDateTime -o:filename Output file or directory -opt:0..10 Set optimization level (0=none, 10=max) -or:classname Use OutputURIResolver class -outval:recover|fatal Handling of validation errors on result document -p:on|off Recognize URI query parameters -r:classname Use URIResolver class -repeat:N Repeat N times for performance measurement -s:filename Initial source document -sa Use schema-aware processing -strip:all|none|ignorable Strip whitespace text nodes -t Display version and timing information -T[:classname] Use TraceListener class -TJ Trace calls to external Java functions -tree:tiny|linked Select tree model -traceout:file|#null Destination for fn:trace() output -u Names are URLs not filenames -val:strict|lax Validate using schema -versionmsg:on|off Warn when using XSLT 1.0 stylesheet -warnings:silent|recover|fatal Handling of recoverable errors -x:classname Use specified SAX parser for source file -xi:on|off Expand XInclude on all documents -xmlversion:1.0|1.1 Version of XML to be handled -xsd:file;file.. Additional schema documents to be loaded -xsdversion:1.0|1.1 Version of XML Schema to be used -xsiloc:on|off Take note of xsi:schemaLocation -xsl:filename Stylesheet file -y:classname Use specified SAX parser for stylesheet --feature:value Set configuration feature (see FeatureKeys) -? Display this message param=value Set stylesheet string parameter +param=filename Set stylesheet document parameter ?param=expression Set stylesheet parameter using XPath !option=value Set serialization option >java -jar saxon9he.jar -q:"..\w3xQueryTut.xq" Unknown option -q:..\w3xQueryTut.xq Saxon-HE 9.2.0.6J from Saxonica Usage: see http://www.saxonica.com/documentation/using-xsl/commandline.html Options: -a Use xml-stylesheet PI, not -xsl argument // etc... >java net.sf.saxon.Query -q:"..\w3xQueryTut.xq" Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/saxon/Query Caused by: java.lang.ClassNotFoundException: net.sf.saxon.Query // etc... Could not find the main class: net.sf.saxon.Query. Program will exit. I'm probably making some stupid mistake. Do you know what it could be?

    Read the article

  • saxon java xpath exception :

    - by changed
    Hi I am trying to read XPath queries from a file and run it against a xml data file. I am doing it through Saxon Xpath processor. But i keep getting this error. Code i am using is from sample code provided with the library. Error i am getting is : Exception in thread "main" javax.xml.xpath.XPathExpressionException: Supplied node must be built using the same or a compatible Configuration at net.sf.saxon.xpath.XPathExpressionImpl.evaluate(XPathExpressionImpl.java:283) at net.sf.saxon.xpath.XPathExpressionImpl.evaluate(XPathExpressionImpl.java:375) at edu.xml.XPathExample.go(XPathExample.java:81) at edu.xml.XPathExample.main(XPathExample.java:42) - public void go(String filename) throws Exception { XPathExpression findLine = null; String readLine = null; Object document = new XPathEvaluator().setSource(new StreamSource(new File(dataPath))); System.setProperty("javax.xml.xpath.XPathFactory:" + NamespaceConstant.OBJECT_MODEL_SAXON, "net.sf.saxon.xpath.XPathFactoryImpl"); XPathFactory xpf = XPathFactory.newInstance(NamespaceConstant.OBJECT_MODEL_SAXON); XPath xpe = xpf.newXPath(); if (filename != null) { this.queryPath = filename; } try { fileReader = new BufferedReader(new FileReader(queryPath)); } catch (FileNotFoundException ex) { System.out.println("File not found: " + ex.getMessage()); } xpe.setXPathVariableResolver(this); while (true) { try { readLine = fileReader.readLine(); } catch (IOException ex) { System.out.println("Error while reading file: " + ex.getMessage()); } if (readLine == null) { break; } findLine = xpe.compile(readLine); String resultString = findLine.evaluate(document); System.out.println("<output>"); System.out.println("String Value => " + resultString); System.out.println("</output>"); } }

    Read the article

  • Cannot access updated Java object from Saxon XSLT processor

    - by chipk
    I am working with an open source version of the Saxon XSLT processor "Saxon 9.0.0.2J from Saxonica" and am trying to make use of the java extensibility for the first time. I am running into an issue I suspect may be a limitation on the open source version, but wanted to check first whether there might be something I am just missing here. From the snippet below, my result is that the final value of $c1 does not change as a result of the call to greg:setTime() - i.e. the $c1 variable within Saxon appears to be unhooked from the underlying Java object and there is no apparent way to access the object as updated by the setTime() call. NOTE that all code in the snippet is tested and working otherwise - i.e. $c1 is properly instantiated by the getInstance() call, $startdate is of the proper format and $d1 is properly instantiated. Thoughts? <xsl:transform ..... xmlns:sql="java:java.sql.Date" xmlns:greg="java:java.util.GregorianCalendar" ..... > .... <xsl:element name="JobExpireDate"> <xsl:variable name="c1" select="greg:getInstance()" /> <xsl:variable name="d1" select="sql:valueOf($startdate)" /> <xsl:variable name="void" select="greg:setTime($c1,$d1)" /> <xsl:value-of select="$c1" /> </xsl:element>

    Read the article

  • Why does Saxon evaluate the result-document URI to be the same?

    - by Jan
    My XSL source document looks like this <Topology> <Environment> <Id>test</Id> <Machines> <Machine> <Id>machine1</Id> <modules> <module>m1</module> <module>m2</module> </modules> </Machine> </Machines> </Environment> <Environment> <Id>production</Id> <Machines> <Machine> <Id>machine1</Id> <modules> <module>m1</module> <module>m2</module> </modules> </Machine> <Machine> <Id>machine2</Id> <modules> <module>m3</module> <module>m4</module> </modules> </Machine> </Machines> </Environment> </Topology> I want to create one result-document per machine, so I use the following stylesheet giving modelDir as path for the result-documents as parameter. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" name="myXML" doctype-system="http://java.sun.com/dtd/properties.dtd"/> <xsl:template match="/"> <xsl:for-each-group select="/Topology/Environment/Machines/Machine" group-by="Id"> <xsl:variable name="machine" select="Id"/> <xsl:variable name="filename" select="concat($modelDir,$machine,'.xml')" /> <xsl:message terminate="no">Writing machine description to <xsl:value-of select="$filename"/></xsl:message> <xsl:result-document href="$filename" format="myXML"> <xsl:variable name="currentMachine" select="Id"/> <xsl:for-each select="current-group()/LogicalHosts/LogicalHost"> <xsl:variable name="environment" select="normalize-space(../../../../Id)"/> <xsl:message terminate="no">Module <xsl:value-of select="."/> for <xsl:value-of select="$environment"/></xsl:message> </xsl:for-each> </xsl:result-document> </xsl:for-each-group> </xsl:template> As my messages show me this seems to work fine - if saxon would not evaluate the URI of the result-document to be the same and thus give the following output. Writing machine description to target/build/model/m1.xml Module m1 for test Module m2 for test Module m1 for production Module m2 for production Writing machine description to target/build/model/m2.xml Error at xsl:result-document on line 29 of file:/C:/Projekte/.../machine.xsl: XTDE1490: Cannot write more than one result document to the same URI, or write to a URI that has been read: file:/C:/Projekte/.../$filename file:/C:/Projekte/.../machine.xsl(29,-1) : here Cannot write more than one result document to the same URI, or write to a URI that has been read: file:/C:/Projekte/.../$filename ; SystemID: file:/C:/Projekte/.../machine.xsl; Line#: 29; Column#: -1 net.sf.saxon.trans.DynamicError: Cannot write more than one result document to the same URI, or write to a URI that has been read: file:/C:/Projekte/.../$filename at net.sf.saxon.instruct.ResultDocument.processLeavingTail(ResultDocument.java:300) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:365) at net.sf.saxon.instruct.Instruction.process(Instruction.java:91) Any ideas on how to solve this?

    Read the article

  • Saxon XSLT-Transformation: How to change serialization of an empty tag from <x/> to <x></x>?

    - by Ben
    Hello folks! I do some XSLT-Transformation using Saxon HE 9.2 with the output later being unmarshalled by Castor 1.3.1. The whole thing runs with Java at the JDK 6. My XSLT-Transformation looks like this: <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://my/own/custom/namespace/for/the/target/document"> <xsl:output method="xml" encoding="UTF-8" indent="no" /> <xsl:template match="/"> <ns:item> <ns:property name="id"> <xsl:value-of select="/some/complicated/xpath" /> </ns:property> <!-- ... more ... --> </xsl:template> So the thing is: if the XPath-expression /some/complicated/xpath evaluates to an empty sequence, the Saxon serializer writes <ns:property/> instead of <ns:property></ns:property>. This, however, confuses the Castor unmarshaller, which is next in the pipeline and which unmarshals the output of the transformation to instances of XSD-generated Java-code. So my question is: How can I tell the Saxon-serializer to output empty tags not as standalone tags? Here is what I am proximately currently doing to execute the transformation: import net.sf.saxon.s9api.*; import javax.xml.transform.*; import javax.xml.transform.sax.SAXSource; // ... // read data XMLReader xmlReader = XMLReaderFactory.createXMLReader(); // ... there is some more setting up the xmlReader here ... InputStream xsltStream = new FileInputStream(xsltFile); InputStream inputStream = new FileInputStream(inputFile); Source xsltSource = new SAXSource(xmlReader, new InputSource(xsltStream)); Source inputSource = new SAXSource(xmlReader, new InputSource(inputStream)); XdmNode input = processor.newDocumentBuilder().build(inputSource); // initialize transformation configuration Processor processor = new Processor(false); XsltCompiler compiler = processor.newXsltCompiler(); compiler.setErrorListener(this); XsltExecutable executable = compiler.compile(xsltSource); Serializer serializer = new Serializer(); serializer.setOutputProperty(Serializer.Property.METHOD, "xml"); serializer.setOutputProperty(Serializer.Property.INDENT, "no"); serializer.setOutputStream(output); // execute transformation XsltTransformer transformer = executable.load(); transformer.setInitialContextNode(input); transformer.setErrorListener(this); transformer.setDestination(serializer); transformer.setSchemaValidationMode(ValidationMode.STRIP); transformer.transform(); I'd appreciate any hint pointing in the direction of a solution. :-) In case of any unclarity I'd be happy to give more details. Nightly greetings from Germany, Benjamin

    Read the article

  • How to select saxon TransformerFactory in Java

    - by pAkY88
    In my web application I need to use Saxon TransformerFactory to use XSLT 2.0 but I can't use setProperty method because I haven't this right on the web server and there is a Security Manager. So i have read that it's possible to do this: Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.transform.TransformerFactory in jars available to the runtime. I found this file in WEB-INF/lib/saxon9.jar but when I istantiate a TransformerFactory is always selected default factory and not saxon factory. How can I select Saxon Transformer Factory? Thanks

    Read the article

  • A beginner question on passthru() function in PHP

    - by Robert
    Hi all, I've used the following code to do an XSLT translation in PHP and save the result SVG file into a sub folder: $command = $java . $saxon . $target2 . ' ' . $xsl2.' '.$param; ob_start(); passthru($command, $result); $content_grabbed=ob_get_contents(); ob_end_clean(); $info = pathinfo($_FILES['file']['name']); $file_name= basename($_FILES['file']['name'],'.'.$info['extension']); $myFile = "images/convert/".$file_name."_".$_POST["mydropdown"].".svg"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, $content_grabbed); fclose($fh); It does a very simple SVG to SVG transformation, and created the resulting SVG file. the $command is just a simple java -jar saxon.jar input.xml stylesheet java command. The current situation is ,the file gets created perfectly, however, the error gets shown in browser, probably because I inserted the "ob_start" before passthru() command. I am thinking of making use of an argument that comes with the saxon.jar, that is "-o output_file_name". Because the final purpose is not to display the resulting SVG to the browser, but instead creating an SVG file ,and provide the link to the user for downloading. Are there any better ways to handle this problem, I am still thinking about how to get rid of the result that gets shown in the browser that is sent by the "passthru()". Thanks in advance for suggestions!

    Read the article

  • XSLT workflow with variable number of source files

    - by chiborg
    I have a bunch of XML files with a fixed, country-based naming schema: report_en.xml, report_de.xml, report_fr.xml, etc. Now I want to write an XSLT style sheet that reads each of these files via the document() XPath function, extracts some values and generates one XML files with a summary. My question is: How can I iterate over the source files without knowing the exact names of the files I will process? At the moment I'm planning to generate an auxiliary XML file that holds all the file names and use the auxiliary XML file in my stylesheet to iterate. The the file list will be generated with a small PHP or bash script. Are there better alternatives? I am aware of XProc, but investing much time into it is not an option for me at the moment. Maybe someone can post an XProc solution. Preferably the solution includes workflow steps where the reports are downloaded as HTML and tidied up :) I will be using Saxon as my XSLT processor, so if there are Saxon-specific extensions I can use, these would also be OK.

    Read the article

  • How to execute XSLT 2.0 with ant ?

    - by paulgreg
    I'm trying to run an XSLT transformation from an ant file. I'm using a XSLT 2.0 stylesheet with a saxon 9 parser (supporting XSLT 2.0). The problem is that it seems that ant is always calling an XSLT 1.0 parser. Here's my ant file : <xslt style="stylesheet.xslt" basedir="core/" extension=".xml" destdir="core/" classpath="D:\\DevTools\\saxon\\bin\\saxon9.jar"> </xslt> If I call it directly (without ant), it's working. Any idea ?

    Read the article

  • XSLT: Transform XML files tree

    - by Myniva
    I have the following file structure (XML files 'index.xml' in nested folders): index.xml foo/index.xml foo/sub/index.xml foo/.../index.xml bar/.../index.xml Now I have to transform each of this XML files with a given XSL stylesheet. The result should be the same folder structure (overwriting would be OK). What would be your approach to achieve this? My system: OS X 10.6, Saxon XSLT processor

    Read the article

  • XSLT: moving a grouping html elements into section levels

    - by Jeff
    Hello there, I'm trying to write an XSLT that organizes an HTML file into different section levels depending on the header level. Here is my input: <html> <head> <title></title> </head> <body> <h1>HEADER 1 CONTENT</h1> <p>Level 1 para</p> <p>Level 1 para</p> <p>Level 1 para</p> <p>Level 1 para</p> <h2>Header 2 CONTENT</h2> <p>Level 2 para</p> <p>Level 2 para</p> <p>Level 2 para</p> <p>Level 2 para</p> </body> </html> I'm working with a fairly simple structure at the moment so this pattern will be constant for the time-being. I need an output like this... <document> <section level="1"> <header1>Header 1 CONTENT</header1> <p>Level 1 para</p> <p>Level 1 para</p> <p>Level 1 para</p> <p>Level 1 para</p> <section level="2"> <header2>Header 2 CONTENT</header2> <p>Level 2 para</p> <p>Level 2 para</p> <p>Level 2 para</p> <p>Level 2 para</p> </section> </section> </document> I had been working with this example: Stackoverflow Answer However, I cannot get it to do exactly what I need. I'm using Saxon 9 to run the xslt within Oxygen for dev. I'll be using a cmd/bat file in production. Still Saxon 9. I'd like to handle up to 4 nested section levels if possible. Any help is much appreciated! I need to append onto this as I've encountered another stipulation. I probably should have thought of this before. I'm encountering the following code sample <html> <head> <title></title> </head> <body> <p>Level 1 para</p> <p>Level 1 para</p> <p>Level 1 para</p> <p>Level 1 para</p> <h1>Header 2 CONTENT</h1> <p>Level 2 para</p> <p>Level 2 para</p> <p>Level 2 para</p> <p>Level 2 para</p> </body> </html> As you can see, the <p> is a child of <body> while in my first snippet, <p> was always a child of a header level. My desired result is the same as above except that when I encounter <p> as a child of <body>, it should be wrapped in <section level="1">. <document> <section level="1"> <p>Level 1 para</p> <p>Level 1 para</p> <p>Level 1 para</p> <p>Level 1 para</p> </section> <section level="1"> <header1>Header 2 CONTENT</header1> <p>Level 2 para</p> <p>Level 2 para</p> <p>Level 2 para</p> <p>Level 2 para</p> </section> </document>

    Read the article

  • Using XSLT, how do I separate nodes based on their value?

    - by Will Goring
    I have a pretty flat XML structure that I need to reorder into categorised sections and, for the life of me, I can't figure out how to do it in XSLT (not that I'm by any means an expert.) Basically, the original XML looks kinda like: <things> <thing> <value>one</value> <type>a</type> </thing> <thing> <value>two</value> <type>b</type> </thing> <thing> <value>thee</value> <type>b</type> </thing> <thing> <value>four</value> <type>a</type> </thing> <thing> <value>five</value> <type>d</type> </thing> </things> And I need to output something like: <data> <a-things> <a>one</a> <a>four</a> </a-things> <b-things> <b>two</b> <b>three</b> </b-things> <d-things> <d>five</d> </d-things> </data> Note that I can't output <c-things> if there aren't any <c> elements, but I do know ahead of time what the complete list of types is, and it's fairly short so handcoding templates for each type is definitely possible. It feels like I could probably hack something together using <xsl:if> and <xsl:for-each> but it also feels like there must be a more ... 'templatey' way to do it. Can anyone help? Cheers.

    Read the article

  • XSLT: How to escape square brackets in Urls

    - by ilariac
    I have a set of records from Solr where field[@name='url'] can have the following format: http://url/blabla/blabla.aspx?sv=[keyword%20keyword,%201] My understanding is that the square brackets denote an array syntax and I would like to use XSLT to remove the square brackets from all Urls. The reason for this is that I am using an Open URL resolver, which does not currently handle well those characters. The best option would be to strip the square brackets from all URLs before such resources are mediated by the Open URL resolver. There are cases where I have multiple occurrences of square brackets per Url. Can you please help me with this? Thanks for your help, I.

    Read the article

  • Improving the performance of XSL

    - by Rachel
    I am using the below XSL 2.0 code to find the ids of the text nodes that contains the list of indices that i give as input. the code works perfectly but in terms for performance it is taking a long time for huge files. Even for huge files if the index values are small then the result is quick in few ms. I am using saxon9he Java processor to execute the XSL. <xsl:variable name="insert-data" as="element(data)*"> <xsl:for-each-group select="doc($insert-file)/insert-data/data" group-by="xsd:integer(@index)"> <xsl:sort select="current-grouping-key()"/> <data index="{current-grouping-key()}" text-id="{generate-id( $main-root/descendant::text()[ sum((preceding::text(), .)/string-length(.)) ge current-grouping-key() ][1] )}"> <xsl:copy-of select="current-group()/node()"/> </data> </xsl:for-each-group> </xsl:variable> In the above solution if the index value is too huge say 270962 then the time taken for the XSL to execute is 83427ms. In huge files if the index value is huge say 4605415, 4605431 it takes several minutes to execute. Seems the computation of the variable "insert-data" takes time though it is a global variable and computed only once. Should the XSL be addessed or the processor? How can i improve the performance of the XSL.

    Read the article

  • Cocoon lite / XML and XSLT publishing framework

    - by bambax
    What publishing frameworks (publishing only, NOT full-blown CMS) based on XML, XSLT sitemaps and pipelines exist, are stable, active, and simpler / lighter than Cocoon? I have glanced at: mod_xslt (http://www.mod-xslt2.com/) which seemed to be exactly that, but looks all but dead, and required a complex setup, and apparently supported only libxslt as an XSLT processor (I'd like to be able to use Saxon and XSLT 2.0 of course). Apache Forrest (http://forrest.apache.org/), but I don't understand if it is really simpler than Cocoon or is rather an additionnal thing on top of Cocoon? What I'm looking for is something that does just this: recieves an HTTP GET "runs it" through a sitemap finds a pipeline: source.xml - xslt1.xsl - xslt2.xsl - xsltn.xsl - serialize runs the pipeline serves the serialized result to the client and: uses Saxon (or is "processor independant") can be installed "lightly", that is: should not require much more configuration than the sitemap Maybe I'm describing an early version of Cocoon, or a future version of an XProc implementation... Anyway, does such a tool exist?

    Read the article

  • placing the matched 2 different child elements xml values in a single line from xslt2.0

    - by Girikumar Mathivanan
    I have the below input xml, <GSKProductHierarchy> <GlobalBusinessIdentifier>ZGB001</GlobalBusinessIdentifier> <Hierarchy> <Material>335165140779</Material> <Level1>02</Level1> <Level2>02AQ</Level2> <Level3>02AQ006</Level3> <Level4>02AQ006309</Level4> <Level5>02AQ006309</Level5> <Level6>02AQ006309</Level6> <Level7>02AQ006309</Level7> <Level8>02AQ006309</Level8> </Hierarchy> <Hierarchy> <Material>335165140780</Material> <Level1>02</Level1> <Level2>02AQ</Level2> <Level3>02AQ006</Level3> <Level4>02AQ006309</Level4> <Level5>02AQ006309</Level5> <Level6>02AQ006309</Level6> <Level7>02AQ006309</Level7> <Level8>02AQ006310</Level8> </Hierarchy> <Texts> <ProductHierarchy>02AQ006310</ProductHierarchy> <Language>A</Language> <Description>CREAM</Description> </Texts> <Texts> <ProductHierarchy>02AQ006309</ProductHierarchy> <Language>B</Language> <Description>CREAM</Description> </Texts> as per the requirement, xsl should check the matched value of GSKProductHierarchy/Hierarchy/Level8 in the GSKProductHierarchy/Texts/ProductHierarchy elements...and its should result as below flat file. 335165140779|02|02AQ|02AQ006|02AQ006309|02AQ006309|02AQ006309|02AQ006309|02AQ006309|02AQ006309|A|CREAM| 335165140780|02|02AQ|02AQ006|02AQ006309|02AQ006309|02AQ006309|02AQ006309|02AQ006310|02AQ006310|B|CREAM| Right now I have the below xslt, <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:set="http://exslt.org/sets" xmlns:str="http://exslt.org/strings" xmlns:java="http://xml.apache.org/xslt/java" xmlns:saxon="http://saxon.sf.net/" exclude-result-prefixes="exsl set str java saxon"> <xsl:output method="text" indent="yes"/> <xsl:variable name="VarPipe" select="'|'"/> <xsl:variable name="VarBreak" select="'&#xa;'"/> <xsl:template match="/"> <xsl:for-each select="GSKProductHierarchy/Hierarchy"> <xsl:variable name="currentIndex" select="position()"/> <xsl:variable name="Level8" select="Level8"/> <xsl:variable name="ProductHierarchy" select="../Texts[$currentIndex]/ProductHierarchy"/> <xsl:if test="$Level8=$ProductHierarchy"> <xsl:value-of select="Material"/> <xsl:value-of select="$VarPipe"/> <xsl:value-of select="Level1"/> <xsl:value-of select="$VarPipe"/> <xsl:value-of select="Level2"/> <xsl:value-of select="$VarPipe"/> <xsl:value-of select="Level3"/> <xsl:value-of select="$VarPipe"/> <xsl:value-of select="Level4"/> <xsl:value-of select="$VarPipe"/> <xsl:value-of select="Level5"/> <xsl:value-of select="$VarPipe"/> <xsl:value-of select="Level6"/> <xsl:value-of select="$VarPipe"/> <xsl:value-of select="Level7"/> <xsl:value-of select="$VarPipe"/> <xsl:value-of select="Level8"/> <xsl:value-of select="$VarPipe"/> <xsl:value-of select="../Texts[$currentIndex]/ProductHierarchy"/> <xsl:value-of select="$VarPipe"/> <xsl:value-of select="../Texts[$currentIndex]/Language"/> <xsl:value-of select="$VarPipe"/> <xsl:value-of select="../Texts[$currentIndex]/Description"/> <xsl:value-of select="$VarPipe"/> <xsl:if test="not(position() = last())"> <xsl:value-of select="$VarBreak"/> </xsl:if> </xsl:if> </xsl:for-each> </xsl:template> can anyone please suggest what function should i need to use to get the desired result. Regards, Giri

    Read the article

  • transformation of UML Diagrams to specification Z using xsl transformation

    - by Mona
    hi. I'm trying to transform some uml diagrams (of singleton , AbstractFactory ...) to Z specification , first i transformed my uml diagram to an xml file using starUML then i used an xsl program and saxon to transform my xml file to .tex( for Z ) , but it didnt work . if someone has an idea about how the xsl program should be written (just maybe the steps) that will be great. thanks

    Read the article

  • java.net.URISyntaxException

    - by aayushi soni
    Hi, I have get this exception. but this exception is not reproduced again. I want to get the cause of this Exception Caught while Checking tag in XMLjava.net.URISyntaxException: Illegal character in opaque part at index 2: C:\Documents and Settings\All Users\.SF\config\sd.xml stacktrace net.sf.saxon.trans.XPathException. Why this exception occured. How to deal with so it will not reproduce.

    Read the article

  • DOCTYPE declaration getting lost when using XSL

    - by Rachel
    The input to my XSL is an XHTML. After applying the XSL the DOCTYPE declaration that was present in the input XHTML gets lost in the output. Do i have an option to copy/retain the DOCTYPE declaration in the output using XSL. The XSL processor that i am using is SAXON.

    Read the article

  • Doing XML extracts with XSLT without having to read the whole DOM tree into memory?

    - by Thorbjørn Ravn Andersen
    I have a situation where I want to extract some information from some very large but regular XML files (just had to do it with a 500 Mb file), and where XSLT would be perfect. Unfortunately those XSLT implementations I am aware of (except the most expensive version of Saxon) does not support only having the necessary part of the DOM read in but reads in the whole tree. This cause the computer to swap to death. The XPath in question is //m/e[contains(.,'foobar') so it is essentially just a grep. Is there an XSLT implementation which can do this? Or an XSLT implementation which given suitable "advice" can do this trick of pruning away the parts in memory which will not be needed again? I'd prefer a Java implementation but both Windows and Linux are viable native platforms. EDIT: The input XML looks like: <log> <!-- Fri Jun 26 12:09:27 CEST 2009 --> <e h='12:09:27,284' l='org.apache.catalina.session.ManagerBase' z='1246010967284' t='ContainerBackgroundProcessor[StandardEngine[Catalina]]' v='10000'> <m>Registering Catalina:type=Manager,path=/axsWHSweb-20090626,host=localhost</m></e> <e h='12:09:27,284' l='org.apache.catalina.session.ManagerBase' z='1246010967284' t='ContainerBackgroundProcessor[StandardEngine[Catalina]]' v='10000'> <m>Force random number initialization starting</m></e> <e h='12:09:27,284' l='org.apache.catalina.session.ManagerBase' z='1246010967284' t='ContainerBackgroundProcessor[StandardEngine[Catalina]]' v='10000'> <m>Getting message digest component for algorithm MD5</m></e> <e h='12:09:27,284' l='org.apache.catalina.session.ManagerBase' z='1246010967284' t='ContainerBackgroundProcessor[StandardEngine[Catalina]]' v='10000'> <m>Completed getting message digest component</m></e> <e h='12:09:27,284' l='org.apache.catalina.session.ManagerBase' z='1246010967284' t='ContainerBackgroundProcessor[StandardEngine[Catalina]]' v='10000'> <m>getDigest() 0</m></e> ...... </log> Essentialy I want to select some m-nodes (and I know the XPath is wrong for that, it was just a quick hack), but maintain the XML layout. EDIT: It appears that STX may be what I am looking for (I can live with another transformation language), and that Joost is an implementation hereof. Any experiences? EDIT: I found that Saxon 6.5.4 with -Xmx1500m could load my XML, so this allowed me to use my XPaths right now. This is just a lucky stroke so I'd still like to solve this generically - this means scriptable which in turn means no handcrafted Java filtering first. EDIT: Oh, by the way. This is a log file very similar to what is generated by the log4j XMLLayout. The reason for XML is to be able to do exactly this, namely do queries on the log. This is the initial try, hence the simple question. Later I'd like to be able to ask more complex questions - therefore I'd like the query language to be able to handle the input file.

    Read the article

  • problem with image urls in htmlhelp created by docbook xsl

    - by newenglander
    I have a Docbook XML document that has some images with special characters in their names (German umlauts). I'm using Saxon 6.5.5 and the Docbook xslt Stylesheets to create HTMLHelp files based on that document. Unfortunately the filenames are then url-encoded (% and hexadecimal code), which internet explorer can't deal with (with firefox it works). I looked for a parameter which could change this feature, but couldn't find any. I also tried to save my image files using the encoded names, but this didn't work either. Does anyone know a good way around this, or will I have to simply forbid special characters in my image names?

    Read the article

  • XSLT transformations in Ruby and JRuby

    - by jpatokal
    Simple question: are there any solid XSLT libraries that work in both Ruby and JRuby? REXML works in both, but does not have XSLT support. ruby-xslt doesn't work in JRuby. The latest Nokogiri betas do support JRuby, but the support is still buggy and throws occasional NullPointerExceptions for XML input that works fine in Ruby. (In particular, any transforms that don't result in valid XML cause it to barf, even if xsl:output is set to 'text'!) JXslt is just a wrapper for Java's Xalan/Saxon and doesn't work in Ruby. Please tell me I'm missing something?

    Read the article

1 2  | Next Page >