xsl

XPath and XSLT 2.0 for .NET? [closed]

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: .NET 3.5 doesn't completely support XPATH 2.0 or XSLT 2.0, which is just too bad. Does anyone know if these two will be included and fully supported in any future .NET versions? 回答1: I don't think they'll add support for XPath 2.0 or XSLT 2.0 any time soon. However, you shouldn't feel bad if these are not part of the BCL, as long as you have 3rd party implementations available: Saxon : XPath 3.1, XQuery 3.1, XSLT 3.0 XmlPrime : XPath 3.1, XQuery 3.1, XSLT 2.0 QueryMachine : XPath 2.0, XQuery 1.0 Lightweight XPath2 for .NET : XPath 2.0 Exselt

Android: Convert xml using xslt

匿名 (未验证) 提交于 2019-12-03 02:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to transform some xml using an xsl-file and output the result somehow (I'm using Android Api Level 8). My current activity looks like this, but the transformer stays null. LogCat throws an System.err with org.apache.harmony.xml.ExpatParser$ParseException , saying the xml is not well-formed, but I made sure it is. I found a hint in LogCat that says SystemId Unknown just before the above error message. What am I doing wrong? import java.io.OutputStream; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import

How to install module for BeautifulSoup XML parsing?

匿名 (未验证) 提交于 2019-12-03 02:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: In this answer , I was told to not use BeautifulSoup(xmlData, 'html.parser') for XML parsing but to use BeautifulSoup(xmlData, 'xml') . That parser, however, does not come with BeautifulSoup . As per one of the comments, I tried: python -m pip install lxml But got: Collecting lxml Using cached lxml - 3.6 . 4.tar . gz Installing collected packages : lxml Running setup . py install for lxml ... error Complete output from command D : \SOFT\Python3\python . exe - u - c "import setuptools, tokenize;__file__='C:\\U sers\\myuser\\AppData\

Java, xml, XSLT: Prevent DTD-Validation

匿名 (未验证) 提交于 2019-12-03 02:00:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I use the Java (6) XML-Api to apply a xslt transformation on a html-document from the web. This document is wellformed xhtml and so contains a valid DTD-Spec ( ). Now a problem occurs: Uppon transformation the XSLT-Processor tries to download the DTD and the w3-server denies this by a HTTP 503 error (due to Bandwith Limitation by w3). How can I prevent the XSLT-Processor from downloading the dtd? I dont need my input-document validated. Source is: import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml

Testing xslt code using your browser

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Using my browser, I want to test if my xslt code is working. Currently I am copy pasting my xml and xslt code into w3school's example page and test it there. However, this is a real pain, since inserting tabs don't work there, syntax highlighting isn't active and the output window is too small. It is inconvenient to test your code there in general. So: What do I have to setup to test my xslt code? Do I have to change the name of the xslt file to xhtml or html? How do you test xslt code in general? I want to call the link file://code.xslt in

How to convert XML to HTML using XSLT in Java

匿名 (未验证) 提交于 2019-12-03 01:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I want to convert XML file into HTML file with help of XSLT. But I am getting an error i.e. javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Invalid byte 1 of 1-byte UTF-8 sequence. XML file 1 John 25 20000 2 Tony 27 23000 3 Eithen 29 25000 XSL file Company Details EmpId EmpName Age Salary Java Code public class TransInfoHtml { public static void main ( String args []) { try { TransformerFactory tFactory = TransformerFactory .

How do you create a PDF from XML in Java?

匿名 (未验证) 提交于 2019-12-03 01:55:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: At the moment, I'm creating an XML file in Java and displaying it in a JSP page by transforming it with XSL/XSLT. Now I need to take that XML file and display the same information in a PDF. Is there a way I can do this by using some kind of XSL file? I've seen the iText Java-PDF library, but I can't find any way to use it with XML and a stylesheet. Any assistance would be much appreciated. Thanks in advance! 回答1: You can use XSL Formatting objects. Here are some good articles on how to do it: http://www.xml.com/pub/a/2001/01/17/xsl

XSLT 2.0 if condition

匿名 (未验证) 提交于 2019-12-03 01:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Need help on XSLT 2.0 transformation. Input xml : <Employee> <Post>Manager</Post> </Employee> pseudo code : if(Employee/Post = 'Manager') then Associate/High = 'Band' else Associate/Low = 'Band' Output xml : <Associate> <High>Band</High> </Associate> <Associate> <Low>Band</Low> </Associate> 回答1: Construct an element dynamically with xsl:element . Other than that, your pseudo code is already pretty accurate. XSLT Stylesheet <?xml version="1.0" encoding="UTF-8" ?> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">

XSLT 1.0 Get Current DateTime

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a node in my XML file containing the following: 2011-12-01T16:33:33Z I wish to take this line and replace it with the current date and time using the same format as shown above. YYYY-MM-DDTHH:MM:SSZ The node is within a namespace declared as 'x' 回答1: Playing with DateTime is not possible with XSLT 1.0 alone .. In a similar situations I took help of scripting .. (C#) Sample XML: 2011-12-01T16:33:33Z Sample XSLT: Resulting Output: 2012-02-22T18:03:12Z The script may reside in a same file (like I have it in my sample XSLT code) or if the

Apache FOP XML - XLS-FO generates invalid pdf

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to create a PDF document with Apache FOP from an xml file that is formatted with an xlst stylesheet to convert the original xml file to an xml-fo formatted xml file. As I'm new to this, I tried to create a simple hello world example, without success. The generation process seems to succeed (no exceptions) but the generated pdf file is invalid for some reason. The size of the file is 4.8KB, and when opened with libreoffice writer, data has definitely been written to the file, but the file does not open in pdf readers. The