xslt-1.0

blank Attribute with value in XML with XSLT transformation

冷暖自知 提交于 2019-12-24 20:01:26
问题 I have below XMl and I need to replace root="" with Dynamic GUID value. this can be anywhere in XML document. it does not work with below XSLT. This is just the extended text to post successfully. <ClinicalDocument xmlns="urn:hl7-org:v3"> <templateId root="2.16.840.1.113883.10.20.22.1.2" extension="2015-08-01"/> <id root=""/> <code code="34133-9" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LN" displayName="Summarization of Episode Note"/> <title>Patient Summary Document</title>

xslt Merge children of 2 parents and Store in a variable

大城市里の小女人 提交于 2019-12-24 19:37:28
问题 I receive an xml input like this: <root> <Tuple1> <child11></child11> <child12></child12> <child13></child13> </Tuple1> <Tuple1> <child11></child11> <child12></child12> </Tuple1> <Tuple2> <child21></child21> <child22></child22> </Tuple2> <Tuple2> <child21></child21> <child22></child22> <child23></child23> </Tuple2> </root> How can I merge the children of each Tuple1 with children of Tuple2 and store them in a variable that will be used in the rest of xslt document? First tuple1 will be merged

Select Distinct Element into a node XSLT

馋奶兔 提交于 2019-12-24 19:34:03
问题 This is my XML code: <SECTOR_LIST> <LIGHT_SECTOR> <SECTOR1>22</SECTOR1> <SECTOR2>92</SECTOR2> </LIGHT_SECTOR> <LIGHT_SECTOR> <SECTOR1>22</SECTOR1> <SECTOR2>92</SECTOR2> </LIGHT_SECTOR> <LIGHT_SECTOR> <SECTOR1>92</SECTOR1> <SECTOR2>137</SECTOR2> </LIGHT_SECTOR> <LIGHT_SECTOR> <SECTOR1>92</SECTOR1> <SECTOR2>137</SECTOR2> </LIGHT_SECTOR> </SECTOR_LIST> I create this XSLT 1.0: <xsl:for-each select="SECTOR_LIST"> <xsl:for-each select="LIGHT_SECTOR"> <xsl:text>VIS </xsl:text> <xsl:value-of select=

How to do a code table lookup in XSLT 1.0

ε祈祈猫儿з 提交于 2019-12-24 19:19:07
问题 How can I do a lookup from a code table in XSLT version 1.0? I tried to do something like this example: https://www.xml.com/pub/a/2002/02/06/key-lookups.html, but I think in that case the data was in the input file and not in the XSLT itself. I created a namespace called "lookup" and tried the following, where my lookup table in the XSLT code itself, but I always get empty values. Do I need to move this to an apply-template structure? <lookup:TenderActionType> <string id='00'>Add</string>

How do I flatten text nodes and nested nodes?

余生长醉 提交于 2019-12-24 19:16:28
问题 I’m trying to flatten an element’s text nodes and nested inlined elements <e>something <inline>rather</inline> else</e> into <text>something </text> <text-inline>rather</text-inline> <text> else</text> Using e/text() would return both text nodes but how do I flatten all nodes in order for arbitrarily inlined elements (even nested)? 回答1: I am not sure "flatten" is the right term for this. It seems all you want to do is change some text nodes into elements containing the same text. This can be

Grouping nested elements in xslt 1.0

帅比萌擦擦* 提交于 2019-12-24 17:11:30
问题 I've been looking at examples of Muenchian grouping in XSLT 1.0, specifically this example here. However I'm unable to get it working on a more complex XML structure. My XML currently looks like this: <?xml version="1.0" encoding="utf-8"?> <ContestResults> <Contests> <Contest sportId="35"> <Sport>Beach Volleyball</Sport> <Event>Men's</Event> <Ranks> <Rank position="1" eventId="1"> <Athlete>Athlete 1a / Athlete 2a [GER]</Athlete> <Result>2</Result> </Rank> <Rank position="2" eventId="1">

Selecting specific entries in a for-each loop?

…衆ロ難τιáo~ 提交于 2019-12-24 17:09:32
问题 I have the following XSL script: <xsl:for-each select="$AssignHistory/AssignmentHistory/*[name()=$week]/StudentItems/Item"> Student (or assistant): <xsl:value-of select="Name"/><br /> </xsl:for-each> The actual XML StudentItems will have a varied number of items in it. Either: 1 7 14 21 If there are 7, then I want to show the list content like this: 1 2 / 3 4 / 5 6 / 7 If there are 14: 1 2 / 3 4 / 5 6 / 7 8 9 / 10 11 / 12 13 / 14 Finally, if there are 21: 1 2 / 3 4 / 5 6 / 7 8 9 / 10 11 / 12

How to remove some tags without removing the content in xslt and pass entire content XML as input to another template

痴心易碎 提交于 2019-12-24 16:26:44
问题 I am working on XSLT. Source XML: <?xml version="1.0" encoding="iso-8859-1"?> <Content> <alertHeader> <ol xmlns="http://www.w3.org/1999/xhtml"> <li> <strong>Review</strong> your current available balance. It can be obtained 24 hours a day, 7 days a week through <a href="/ALL_UNDER_123">Account Activity</a> any 123 ATM or by calling <a id="dynamicvariable" href="#" name="Customercare">[Customercare]</a> at <a id="dynamicvariable" href="#" name="contactNo">[contactNo]</a> . </li> <li> <strong

XSLT: Passing Excel text color parameter to templates

穿精又带淫゛_ 提交于 2019-12-24 15:59:41
问题 This one has left me completely confused. I have a multi text color cell. Most of the data is shared in one way or another so I wanted to use templates to do most of work. To do that I sought to pass the text color as a parameter to the template. A super simple example: <xsl:variable name="textColor"> <xsl:choose> <xsl:when test="$cellColor = 's73'"> <xsl:text>#FFFFFF</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>#000000</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:call

XSLT to copy element without namespace

☆樱花仙子☆ 提交于 2019-12-24 13:25:45
问题 I'll firstly qualify that I'm not particularly good at XSLT. But what I'm trying to do is to copy 3 XML documents into one parent document. The XSLT works fine, except that the parent nodes are being printed with xmlns="" attribute which is causing my validations to fail. So my question is how do I copy these elements out from the separate documents without it adding that xmlns attribute? This is sample of the output to the destination - note I want it to not print the xmlns="". <Feed xmlns=