xsl

XSLT - Checking for a substring

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have two XSLT variables as given below: <xsl:variable name="staticBaseUrl" select="'https://www.hello.com/htapi/PrintApp.asmx/getGames?contentId=id_sudoku&uniqueId="123456"&pageformat=a4'" /> <xsl:variable name="dynamicUrl" select="'https://www.hello.com/htapi/PrintApp.asmx/getGames'" /> How to check whether the second string (dynamicUrl) is a substring of the first string (staticBaseUrl) or not? 回答1: To check if one string is contained in another, use the contains function. Example: <xsl:if test="contains($staticBaseUrl,$dynamicUrl)">

Open source command line tool for Linux to diff XML files ignoring element order

匿名 (未验证) 提交于 2019-12-03 02:51:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there an open source command-line tool (for Linux) to diff XML files which ignores the element order? Example input file a.xml : <tag name="AAA"> <attr name="b" value="1"/> <attr name="c" value="2"/> <attr name="a" value="3"/> </tag> <tag name="BBB"> <attr name="x" value="111"/> <attr name="z" value="222"/> </tag> <tag name="BBB"> <attr name="x" value="333"/> <attr name="z" value="444"/> </tag> b.xml : <tag name="AAA"> <attr name="a" value="3"/> <attr name="b" value="1"/> <attr name="c" value="2"/> </tag> <tag name="BBB"> <attr name="z"

How do you add an image?

匿名 (未验证) 提交于 2019-12-03 02:50:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a simple XML document that contains image information. I need to transform it to HTML -- simple, right? However, when I use the XSL below, it blows up with the error "Cannot write an attribute node when no element start tag is open." I can't see where the open tag is -- any ideas? XML: <root> <HeaderText> <HeaderText>Dan Testing</HeaderText> </HeaderText> <Image> <img width="100" height="100" alt="FPO lady" src="/uploadedImages/temp_photo_small.jpg"/> </Image> <BodyText> <p>This is a test of the body text<br /></p> </BodyText>

How to generate pdf from docbook 5.0

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've written a docbook 5.0 document with the header: <?xml version="1.0" encoding="UTF-8"?> <book version="5.0" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:svg="http://www.w3.org/2000/svg" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:db="http://docbook.org/ns/docbook"> and docbook2pdf on Ubuntu 9.10 prints many error messages and doesn't do any pdf document. The errors are: openjade:test.xml:2:0:E: prolog can

Converting a Cognos XML Schema file to XML using Javascript code

匿名 (未验证) 提交于 2019-12-03 02:43:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I found many "converters" online that will do this for you, but I haven't been able to find any source code that I can easily implement. I was wondering if anyone would be so kind to provide me with suggestions or even provide me with code that will do this task for me. I am trying to convert to XML so it will be easier to parse. I am trying to convert this (Cognos XML Schema)... <?xml version="1.0" encoding="utf-8" ?> - <dataset xmlns="http://developer.cognos.com/schemas/xmldata/1/" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"> - <!

XSLT output formatting: keep line breaks, remove indent

匿名 (未验证) 提交于 2019-12-03 02:42:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Here's my XML: <doc> <article> <texte> <notes>-</notes> <content> <title>T 1</title> <argument>Arg 1</argument> <p>Paragraph 1.1</p> <p>Paragraph 1.2</p> <p>Paragraph <i>1.3</i></p> <short-author>FB</short-author> </content> <notes>-</notes> <content> <title>T2</title> <p>Paragraph 2.1</p> <short-author>JD</short-author> </content> <notes>-</notes> <content> <title>T3</title> <argument>Arg 3</argument> <p>Paragraph 3.1</p> <short-author>NC</short-author> </content> </texte> </article> </doc> This is the XSL (thanks Dimitre): <xsl:stylesheet

XSLT: How to find the count of unique children of a node?

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My XML looks like this: <foo> <bar name="a"> <baz name="xyz"> <time>2</time> <date>3</date> </baz> </bar> <bar name="b"> <baz name="xyz"> <time>2</time> <date>3</date> </baz> </bar> <bar name="c"> <baz name="xyz"> <time>2</time> <date>3</date> </baz> </bar> </foo> I am writing an XSL that needs to function like this: If all the baz children are same then doSomething else doSomethingElse . My current node is foo . I am new to XSLT and I am aware of the conditionals in XSL. It looks something like this as of now: <xsl:template match="foo">

How to manipulate with UL with jQuery in XML+XSL generated HTML?

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This is the XML: <?xml version="1.0"?> <?xml-stylesheet href="a.xsl" type="text/xsl"?> <root/> This is the a.xsl stylesheet: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/1999/xhtml" version="2.0" exclude-result-prefixes="xs"> <xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:template match="/"> <xsl:text disable-output-escaping="yes"><!DOCTYPE html></xsl:text> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery

Split XML nodes based on particular text

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Please suggest for how to split the xml nodes based on particular comment text (<!--Break-->). I tried thru using xsl:text disable-output-escaping format to place the required closing and opening tags (elements). My code is static, how to make that dynamic code which will work for any numbers of ancestor with respect to comment text, i.e., if ancestor count ' n ', then from n to 1 how to make use of call-template method. some empty nodes are presented which are not ancestor to the content, how to avoid these I referred some suggestions from

wrirting XSL to perform some operations on xml data

匿名 (未验证) 提交于 2019-12-03 02:35:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: How to write xsl in the body of products.xsl that will get product name and condition with quantity > 10 products.xml: <? xml version = "1.0" encoding = "iso-8859-1" ?> <products> <product> <name> soaps </name> <quantity> 10 </quantity> <condition> ready </condition> </product> <product> <name> soaps </name> <quantity> 15 </quantity> <condition> ready </condition> </product> <product> <name> soaps </name> <quantity> 20 </quantity> <condition> ready </condition> </product> </products> products.xsl <? xml version = "1.0" ?> <!--