xslt

Removing a tag with XLST: namespace issue

拈花ヽ惹草 提交于 2021-01-28 09:23:07
问题 I'm new to XSLT. I'm trying to create a simple transformation which would remove a certain tag from an XML file. The tag I'm trying to remove has a namespace declaration. The idea is to get out of the following input: <?xml version="1.0" encoding="utf-8" ?> <ToBeRemoved xlmns:prx="urn:something"> <n0:ToRemain xlmns:n0="https://somethingelse.com/def.xsd"> <Data> ... </Data> </n0:ToRemain> </ToBeRemoved> the following: <?xml version="1.0" encoding="utf-8" ?> <n0:ToRemain xlmns:n0="https:/

Removing a tag with XLST: namespace issue

喜你入骨 提交于 2021-01-28 09:15:17
问题 I'm new to XSLT. I'm trying to create a simple transformation which would remove a certain tag from an XML file. The tag I'm trying to remove has a namespace declaration. The idea is to get out of the following input: <?xml version="1.0" encoding="utf-8" ?> <ToBeRemoved xlmns:prx="urn:something"> <n0:ToRemain xlmns:n0="https://somethingelse.com/def.xsd"> <Data> ... </Data> </n0:ToRemain> </ToBeRemoved> the following: <?xml version="1.0" encoding="utf-8" ?> <n0:ToRemain xlmns:n0="https:/

Rename the root node in xml using xslt

南笙酒味 提交于 2021-01-28 09:08:16
问题 I am new to xslt and was trying to find a solution to my problem below. I have a xml, and using xslt I need to do the following just rename the root node to something else (without copying the entire structure of root node into another tag) Get rid of the namespaces information in nodes/elements/attributes Below is my XML <lbl:ABCD> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lbl="http://abc.xyz.com/abc/xsd/sdf/aaaa" xsi:schemaLocation="http://abc.ayx.com/sdf/xsd/label/efr efr

How to fix a special character in XSLT

ぐ巨炮叔叔 提交于 2021-01-28 08:52:51
问题 I am dealing with below XML where I need to remove a special character in firstname. é in (Andrés) not sure what is this character is actually called. If I process firstname as is it's failing in the Vendor system <?xml version="1.0" encoding="UTF-8"?> <reportentry> <reportdata> <id>12345</id> <firstname>Andrés</firstname> <lastname>Williams</lastname> </reportdata> </reportentry> I simply tried replace function which is working, below is the code. Not sure is there any better way to deal

Calculating element max attribute value fails using XSLT and XPath

余生颓废 提交于 2021-01-28 08:01:35
问题 I am coding a ui.xsl to translate ui.xml into ui.html. The ui.xml is: <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <layout class="QGridLayout" name="gridLayout_2"> <item row="8" column="1" colspan="12"> </item> <item row="11" column="1" colspan="2"> </item> <item row="11" column="3" colspan="2"> </item> <item row="11" column="5" colspan="2"> </item> <item row="11" column="7" colspan="3"> </item> <item row="1" column="6" colspan="3"> </item> <item row="2" column="1" colspan="3"> <

XSLT Transform to remove namespaces from all elements, then specify namespace on one

旧街凉风 提交于 2021-01-28 07:42:05
问题 I need to transform this XML and remove all the namespaces. However I need a new namespace on any element named Id only if it is child of CompanyKey. Additionally, if easily done, remove the highest level element. I need it to work in XSLT 2.0. I think I can do most of this with separate transforms but it would be best if it all worked in one. If changing the alias ns1 to mean a different namespace in the output is problematic, I could use a completely different one like 'xyz'. Here is the

XSLT-1.0: How to insert an element at a specific position with respect to the parent element

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-28 07:22:20
问题 I am trying to find out the position of a child element with respect to its parent. I have the following input XML: <Begin> <tag1>g</tag1> <tag2>b</tag2> <tag3>c</tag3> <tag5>e</tag5> </Begin> I need to know the position of <tag3> with respect to <Begin> , i.e. 3 Can this be done in XSLT? My current XSLT looks like this: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" indent="yes" omit-xml-declaration="yes"/> <xsl:strip

How to merge 2 XML files in to one with #Java Script or #XSL ?

送分小仙女□ 提交于 2021-01-28 07:09:41
问题 I have 02 XML files, I need to generate a report with the data combination of both the files. either Out put as an HTML file or Single XML with using XSLT File1 <FitnessCenter> <Member id="1" level="platinum"> <Name>Kamal</Name> <Phone type="home">2921234</Phone> <Phone type="work">2581247-293</Phone> <FavoriteColor>brown</FavoriteColor> <MembershipFee>1000</MembershipFee> </Member> <Member id="2" level="silver"> <Name>Wasantha</Name> <Phone type="home">2934321</Phone> <Phone type="work"

Saxon-HE Integrated Extension Functions

泄露秘密 提交于 2021-01-28 06:54:05
问题 I should have originally posted my question by stating that our code was using an embedded saxon extension function - saxon:parse($xml) which returned the root element/node of the xml. However, in Saxon-HE that extension is no longer available - so I am trying to write an Integrated extension that parses an xml string into a document and returns the root element. I am using Saxon-HE 9.5.1.6 - I am trying to write an Integrated Extension Function that returns the ROOT Node of a Document. The

org.openqa.selenium.NoSuchElementException

泪湿孤枕 提交于 2021-01-28 06:31:34
问题 I am trying to import login credential like: username and password using xsl sheet, by using below code but I got NoSuchElementException exception while running, my xsl sheet looks like: username | password -------------------------- jan30selenium | selenium am using: eclipse webdriver.iostream selenium tool Login.java: package Iostream; import java.io.FileInputStream; import jxl.Sheet; import jxl.Workbook; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa