XML

20K

Solutions

13K

Contributors

Extensible Markup Language (XML) refers to the encoding of documents such that they can be read by both machines and humans. XML documents use tags to show the beginning and end of a set of data. XML is used extensively on websites to show volumes of data, and is the default for a number of office productivity suites. This topic includes discussions of XML-related technologies, such as XQuery (the XML Query language), XPath (the XML Path language), XSLT (eXtensible Stylesheet Language Transformations), XLink (the XML Linking language) and XPointer (the XML Pointer language).

Share tech news, updates, or what's on your mind.

Sign up to Post

In the attached stylesheet I need to transform the XML to add various counters the trailer elements.  An example is the CTT_347 element that needs to contain the count of the IT1_01 nodes within the same SG0.  My code worked well until I had two SG0 nodes in the file.  The second CTT_347 node gets the total of all the IT1_01 nodes from all the previous SG0 nodes as well as the current one which is wrong.

Is it possible with a single Xpath expression to get a count of only the IT1_01 nodes within the current SG0 node?

   <xsl:template name="HL_segments">
      <xsl:choose>
         <xsl:when test="name() = 'CTT' ">
            <xsl:element name="CTT">
               <xsl:element name="idCTT">CTT</xsl:element>
               <xsl:element name="CTT_354">
                  <xsl:value-of select="count(preceding::IT1_01)"/>
               </xsl:element>
            </xsl:element>
         </xsl:when>


<?xml version="1.0" encoding="ISO-8859-1"?>
<ACTIS>
   <ISA>
   </ISA>
   <GS>
   </GS>
   <SG0>
      <ST>
         <idST/>
         <ST_143>810</ST_143>
         <ST_329>0001</ST_329>
      </ST>
      <BIG>
      </BIG>
      <IT1_01>
      </IT1_01>
      <IT1_01>
      </IT1_01>
      <IT1_01>
      </IT1_01>
      <IT1_01>
      </IT1_01>
      <CTT>
         <idCTT/>
         <CTT_354/>
         <CTT_347/>
         <CTT_81/>
         <CTT_355_01/>
         <CTT_183/>
         <CTT_355_02/>
         <CTT_352/>
      </CTT>
    …
0
Free Tool: SSL Checker
LVL 12
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

I use an Excel table I use as a template for my internal customers to fill out. I run a Change Board at my company and this table calculates risk based up constrained answer provided by the requestor. I am looking for a way to incorporate the risk matrix into a webform of some sort which the user completes and results in a calculated score. Afterward, it would be great if this form outputs the resulting user data and calculated score in some usable format (eg. XML or similar).

Question: are there some options for doing this without having to create a custom application is some language such as C# or C++?

Thank you!
JohnDClient-CAB_Risk_Info_Matrix-EEa.xlsm
0
I am attempting to recover a Token from an HTTPS server.
There is a  correctly installed Certificaton my PC that when used via a web page returns a Token

Code is in VBA  WinhttpRequest

When the code is run it returns an error  on the send line

Error 800700b7
"Cannot create file when that file already exists."
The same error is returned regardless of the contents of the strSource xml file.

I cannot understand what file it is trying to create.

<Code>
Dim HttpReq1 As WinHttpRequest
   
  Set HttpReq1 = New WinHttpRequest
 
  HttpReq1.Open "GET", "https://secure.authentxxxxx.com/Authenticator/Token.asmx", False
  HttpReq1.setRequestHeader "Content-Type", "application/soap+xml; charset=UTF-8" '
 
  HttpReq1.SetClientCertificate "CURRENT_USER\My\AurtxxxUAT01"
  HttpReq1.setRequestHeader "Content-Type", "text/xml; charset=UTF-8"
  HttpReq1.setRequestHeader "SOAPAction", "http://www.uk.experian.com/WASP/STS"
  HttpReq1.send strSource   'strSource is an XML string with SOAP headers etc.

<Code end>
0
How would you code a conditional sum in SQL XML Xquery based on a derived sql value using the table ID  passageProfileID which is in the XML?

I need to conditionally sum psg based off a derived value that exists as an ID in the XML but is derived from a SQL table. Which results in returning an 'L' or a 'B'

Any ideas on how to do that?

SELECT b.VoyageResultID,
       b.VoyageID,
         c.VoyageObjectXML.value('sum(root/legs/item/LegDto/days)', 'numeric(28,17)') as Portdays,
       c.VoyageObjectXML.value('sum(root/legs/item/LegDto[type="L"]/days)', 'numeric(28,17)') as PortdaysL,
         c.VoyageObjectXML.value('sum(root/legs/item/LegDto[type="D"]/days)', 'numeric(28,17)') as PortdaysD,
         c.VoyageObjectXML.value('sum(root/legs/item/LegDto[type="I"]/days)', 'numeric(28,17)') as PortdaysI,
         c.VoyageObjectXML.value('sum(root/legs/item/LegDto[type="C"]/days)', 'numeric(28,17)') as PortdaysC,
         c.VoyageObjectXML.value('sum(root/legs/item/LegDto/psg)', 'numeric(28,17)') as PassageDays,

          -- I need to conditionally sum psg based off a derived value that exists as an ID in the XML but is derived from a SQL table. Which results in returning an 'L' or a 'B'
          --SELECT LEFT([dbo].[udsfGetDictionaryName]('Passage Type' , PassageTypeDictionaryID),1) AS PassageType
          --  FROM [dbo].[tblVesselProfilePassage] WHERE [VesselProfilePassageID] = 13932

         b.IsActive
FROM [dbo].[tblVoyage] a
JOIN [dbo].[tblVoyageResult] b ON b.VoyageID = …
0
Im trying to figure out how to write a conditional sum in SQL XML based on another node in this case when type is 'L' then sum only those days.

Does any know the syntax for that?




<root>
<legs>
     <item>
      <LegDto>
        <type>L</type>
        <cost>15000</cost>
        <days>2</days>
     </LegDto>
    </item>
<legs>
<root>

SELECT b.VoyageResultID,
       b.VoyageID, 
	   c.VoyageObjectXML.value('sum(root/legs/item/LegDto/days)', 'numeric(28,17)') as Portdays,  -- The straight sum works fine
          c.VoyageObjectXML.value('sum(root/legs/item/LegDto/days)', 'numeric(28,17)') as Portdays,  -- SUM only if (root/legs/item/LegDto/type) = 'L' 


	   b.IsActive
FROM [dbo].[tblVoyage] a 
JOIN [dbo].[tblVoyageResult] b ON b.VoyageID = a.VoyageID 
CROSS APPLY (SELECT CONVERT(XML,cc.VoyageObject) AS VoyageObjectXML 
             FROM [dbo].[tblVesselVoyageResultXML] cc 
			 WHERE cc.VoyageResultID = b.VoyageResultID) c
ORDER BY b.VoyageID,b.VoyageResultID,b.IsActive

Open in new window

0
Dear all
We received xml documents from our partner that could be easily be opened manually with excel document. With output  format xlsx

We are looking for DOS or powershell based script that we can used to automate the conversion.

Any ideas how the script might look like. or some tutorials, that could help us solve this issue?
0
I use Excel 2016 with classic VBA. I do not use .NET.
Due to a windows 10 system crash, I have to reload the XML Custom UI editor for Microsoft Office, for use with MS Office 2016 (Excel).
When I tried to download the app from the web, I got a request to install ,NET which I did not get when I first installed the XML editor, pre-crash.

What is the correct procedure for downloading Custom UI editor for Microsoft Office, for use with  excel 2016?
Which site ought I to download the xml editor from?

Recommendation for an additional more agile freeware XML editor would be appreciated.

Thanks,
Kelvin
0
Where are editing time, previously modified and created dates stored in the xml file of a word document and is it possible to edit it? I have found modified and created dates, but when I edit it, it changes to current time because I made a change to the document. Also, sometimes when I edit the created date, It is inconsistent with what shows when you click on the properties in file explorer (but is consistent in other tabs of properties). I have not found editing time, and have no idea how the time is formatted.
0
Here is a simplet question for someone but is driving me nuts!

I have some xml as follows and would like to get hld of the "variables" node.

declare @myXML xml ;
declare @variables xml ;

set @myXML = '<root><FromDate>2016-01</FromDate><ToDate>2017-01</ToDate><Period/><Units><Unit><Name>2808</Name></Unit></Units><Variables><Variable><Name>Q01</Name></Variable></Variables><Filters/></root>';

Open in new window


How do i get the sub node "Variables" and its children into the variable @variables?

so @variables would be "<Variables><Variable><Name>Q01</Name></Variable></Variables>"

/Many thanks.
0
Hi Experts,

I'm looking to modify the below to be an update instead of a select.
however not sure where do I put in the body param as specified below
https://howto.caspio.com/web-services-api/rest-api/older-rest-api-versions/table-operations/

Function GetDataFromCASPIO1()
    Dim objHTTP As New WinHttp.WinHttpRequest
    Dim docXML As MSXML2.DOMDocument
    Dim ResponseText As String
    Dim curNode As IXMLDOMNode
    Dim oNodeList As IXMLDOMSelection
    Dim s As String

    Set docXML = New MSXML2.DOMDocument

    Set objHTTP = New WinHttp.WinHttpRequest
    URL = "https://MyAccount.caspio.com/oauth/token"
    
    objHTTP.Open "POST", URL, False
    objHTTP.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"

    objHTTP.Send 
    ResponseText = Right(objHTTP.ResponseText, Len(objHTTP.ResponseText) - 17)
    access_token = Left(ResponseText, InStr(ResponseText, """") - 1)
    'Debug.Print access_token


    Set objHTTP = New WinHttp.WinHttpRequest

    URL = "https://MyAccount.caspio.com/rest/v1/tables/Skilled_Nursing_Visit_Note/rows?q={""limit"":10000,""where"":""visit_date>=GetDate()-7""}"

    '''objHTTP.Open "GET", URL, False
    objHTTP.Open "Put", URL, False
    objHTTP.SetRequestHeader "Accept", "application/xml"
    objHTTP.SetRequestHeader "Content-Type", "application/json"
    objHTTP.SetRequestHeader "Authorization", "Bearer " + access_token


    objHTTP.Send
    'Debug.Print objHTTP.Status
    'Debug.Print objHTTP.ResponseText
  

Open in new window

0
Cloud Class® Course: Ruby Fundamentals
LVL 12
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

apart from the "Elements" at top like GetCourseDetailsRequest, GetCourseDetailsResponse
 why we have Types at bottom like Status and CourseDetails at the bottom
<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
	targetNamespace="http://xyz.com/courses" xmlns:tns="http://xyz.com/courses"
	elementFormDefault="qualified">

	<xs:element name="GetCourseDetailsRequest">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="id" type="xs:int" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="GetCourseDetailsResponse">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="CourseDetails" type="tns:CourseDetails" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="GetAllCourseDetailsRequest">
		<xs:complexType>
		</xs:complexType>
	</xs:element>

	<xs:element name="GetAllCourseDetailsResponse">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="CourseDetails" type="tns:CourseDetails"
					maxOccurs="unbounded" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="DeleteCourseDetailsRequest">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="id" type="xs:int" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="DeleteCourseDetailsResponse">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="status" type="tns:Status" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:simpleType name="Status">
		

Open in new window

0
Hi Experts,

I have the following lines of code retrieving all records from a particular table.
Would like to build a SQL string that will insert them into a local Access table.

Can someone help me accomplish that?

PS. there are different datatypes, so perhaps its also possible to inspect the Access datatype for that field before adding it to the SQL string..

    strXPathQuery = "Caspio/Row"
    Set oNodeList = docXML.selectNodes(strXPathQuery)
    For n = 0 To (oNodeList.length - 1)
        Set curNode = oNodeList.Item(n)

        For m = 0 To (oNodeList.Item(n).childNodes.length - 1)
            Debug.Print oNodeList.Item(n).childNodes(m).nodeName + " => " + oNodeList.Item(n).childNodes(m).Text

        Next
    Next

Open in new window


Thanks in advance.
0
for consuming web service apart from WSDL why we need to provide XSD of XML again?

WSDL it self has all information about request and responses right?

in <wsdl:types> element of wsdl has the xsd name in it?
xmls:tns means what in wsdl
what is
xmlns:soap means?
targetNamespace="http://xyz.com/courses"> means what?
in <wsdl:types> what is <xs:complexType name="courseDetails"> means?
why we use it?
Please advise with any good links, references, code examples, video tutorials etc
0
dear all
i have the below sql function , i am using xamarin android application , how can i write in in sql lite ?

 
     create function dbo. SocFn_RoundQty
(@mnt float)
RETURNS decimal(18,4)
With encryption
AS 
BEGIN
      declare @mnt1 decimal(18,4), @mnt_r decimal(18,4), @nbr bigint
      declare @ST_NB_DECIMAL_QTY INT
      set @mnt1 = @mnt
      select @ST_NB_DECIMAL_QTY = 4
      set @nbr = POWER(10 ,@ST_NB_DECIMAL_QTY) 
      Set @mnt_r = round(@nbr * @mnt1,@nbr)
      IF @mnt_r < 0
            Set @mnt_r = CEILING(@mnt_r)/ @nbr
      ELSE
            Set @mnt_r = FLOOR(@mnt_r)/ @nbr
      Return @mnt_r
END

Open in new window

0
I'm relatively new to working with XML data.  Have requested format from a client that looks like:

<?xml Version="1.0" encoding="UTF-8"?>
<ClientName>
     <FA>
          <Document_Type>FA</Document_Type>
          <FileName_Sent>1234_provider_1234</FileName_Sent>
          <Reject_reason_Description/>
     </FA>
</ClientName>

Open in new window

I'm a bit confused by line 6, is that a valid syntax to represent a node that has no data, as opposed to:
          <Reject_reason_Description></Reject_reason_Description>

Open in new window

0
I've got a client who has a legacy application which downloads XML files from an FTP site, merges those documents into a single file, and then uploads the data to an Access database.  The general format of these downloaded XML documents looks like the following, with a node for filename and then one or more orders.
xml file formatThe code for that operation currently looks like:
Public Sub MergeOrders()
    Dim oFileSys
    Dim oFolder
    Dim aFiles
    Dim file
    Dim xmlPath1
    Dim xmlPath2
    Dim xmldoc1: Set xmldoc1 = CreateObject("MSXML2.DomDocument")
    Dim xmldoc2: Set xmldoc2 = CreateObject("MSXML2.DomDocument")
    Dim Orders
    Dim Order
    Dim NodeToRemove
    Dim strZeroLenFiles
	
    Set NodeToRemove = xmldoc1.selectNodes("/HaworthOrders/FileName")
	
    Set oFileSys = WScript.CreateObject("Scripting.FileSystemObject")
    Set oFolder = oFileSys.GetFolder(ftpLocalDir)
    Set aFiles = oFolder.Files
    strZeroLenFiles = ""
	
    For Each file In aFiles

        If file.size = 0 then
		
	    if strzerolenfiles <> "" then strZeroLenFiles = strZeroLenFiles & vbCrLf
	    strZeroLenFiles = strZeroLenFiles & File.Name
			
	Else 
	
	    If len(xmlPath1) = 0 then

	        xmlPath1 = oFolder +"\" + file.name
		xmldoc1.async = False
		xmldoc1.load xmlpath1		
		xmldoc1.setProperty "SelectionLanguage", "XPath"
  	    Else
		xmlPath2 = oFolder +"\" + file.name 
	    End If
			
	    If len(xmlPath1) > 0 And len(xmlPath2) > 0 Then

		xmldoc2.async = 

Open in new window

0
Hello,

I have a following xml data in my table column...

<?xml version="1.0" encoding="UTF-8"?>
<xmlstats created="Mon Jun 23 05:00:00 EDT 2015" includes="iostats" version="2">
<iostats>
<pool delete="0" insert="0" name="example_name" select="532590" select_onesec="1801" select_tensec="409" update="0">
<change_request delete="0" insert="0" mean_delete="0" mean_insert="0" mean_select="4" mean_update="0" select="1" select_onesec="0" select_tensec="0" update="0"/>
<change_task delete="0" insert="0" mean_delete="0" mean_insert="0" mean_select="8" mean_update="0" select="2" select_onesec="0" select_tensec="0" update="0"/>
.
.
.

Open in new window

I want to get data from it to get info in following order...

id, pool_name, pool_child_name, delete_value, insert_value, update_value...

for example...

23, example_name, change_request, 0, 0, 0...
...
32, example_name, change_task, 0, 0, 0...

I was able to get all info except these names marked bold.

Please help.
0
Hi , i need small help regarding file choose. Now i am working on post api macro it is working fine with current code but it is don't have any option to choose xml file from local system. So i need to change directory path every time. Some please help on this

Sub HTTPPost()
  'create an xml object
 
  Set oXML = CreateObject("MSXML2.DOMDocument")
 
  'load the xml file
 
 
    oXML.Load ("C:\Users\nypaul\Desktop\API fezs\testing.xml")
    ' MsgBox (oXML)
  Set oHTTP = CreateObject("MSXML2.ServerXMLHTTP")
  oHTTP.setOption(2) = (oHTTP.getOption(2) - SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS)
  oHTTP.Open "POST", "https://apss.dd.xxxxxxx.com/gateway/CustomerOrder/1.0/CustomerOrder", False, "xxxxx", "xxxxx"
  'oHTTP.setRequestHeader(”Content-type”, “application/x-www-form-urlencoded" ; charset=UTF-8")
  'oHTTP.setRequestHeader "xxxxxx", "oxxx"
  oHTTP.setRequestHeader "Content-Type", "application/xml"
  oHTTP.setRequestHeader "Accept", "application/xml"
  oHTTP.setRequestHeader "xxxxxxxxxxxx", "163c4821-5axxxx-xxxxx-xxxx"
  oHTTP.setRequestHeader "Authorization", "xxxxxxxxxxxxxxxxxx"
  oHTTP.send oXML
MsgBox (oHTTP.ResponseText)
End Sub
0
sample.phpRunning, or utilising PHP scripts from VB6.

I have a large VB6 application which I developed over many years, and has been operating for many many years now.

My software has no issue consuming Web Services using MSXML2 to call various XML and JSON feeds.

However, in this instance, I need to communicate back and forward, and I'm slightly stumped as to best way to move forward. I've been presented with a PHP code which (a) has a login function to get a authorisation code, and (b) using that authorisation code, I need to send variables to submit a transaction, which supposedly will return a response.

I've attached the basic (modified) PHP script, and I'm looking for "nudges" in the right direction. The variables needed to pass to the login function, and order function are contained in my vb6 software.

Much Appreciated any assistance.
0
Cloud Class® Course: Microsoft Exchange Server
LVL 12
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Need to convert a value in XML from 7/15/2017 3:48:40 PM  to 7/15/2017    The value is retrived from this statement currently in the XML Code
<Value>=Fields!ExpiryDate.Value</Value>

How can I change <Value>=Fields!ExpiryDate.Value</Value>   so only the Date is returned
0
I have a pretty large XML column in a MS SQL database and I want to parse the XML node data out to a report from MS-SQL.

Here is the script I am using, which executes without errors, but returns no data.  The XML node data I want are just those in the SELECT statement but I have about 7,000 data that I need to run a report against.  

Can someone please provide direction on what I am missing in the script?

Thank you so very much in advance;
Jeff


SELECT
      upro.primaryKey,
      xmldata.XmlCol.value('(EmployeePerson/CompanyCode)[1]','VARCHAR(10)') AS CompanyCode,
      xmldata.XmlCol.value('(EmployeePerson/EmployeeNumber)[1]','INT') AS EmployeeNumber,
      xmldata.XmlCol.value('(EmployeePerson/FirstName)[1]','VARCHAR(50)') AS FirstName,
      xmldata.XmlCol.value('(EmployeePerson/LastName)[1]','VARCHAR(50)') AS LastName,
      xmldata.XmlCol.value('(EmployeePerson/People/Person/EmailAddress)[1]','VARCHAR(100)') AS EmailAddress
FROM dbo.UproEmpRawXmlData upro
CROSS APPLY upro.XMLData.nodes('/Envelope/Body/FindPeopleResponse/FindPeopleResult/Results') xmldata(XmlCol);




<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
    <s:Header>
        <a:Action s:mustUnderstand="1">http://www.somewebapi.com/services/employeeperson/IEmployeePerson/FindPeopleResponse</a:Action>
    </s:Header>
    <s:Body>
        <FindPeopleResponse xmlns="http://www.somewebapi.com/services/employeeperson">
            <FindPeopleResult …
0
How can we skip or delete doctype while transforming one xml into another xml

the problem is while i loading xml with vba program that cant able to read xml sheet due to DTD. if i am disable dtd it is working fine. can you help me to understand what changes are required for vba to ignore DTD?

my xml sheet start like <?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE Pip3B12ShippingOrderRequest SYSTEM "3B12_MS_V01_02_ShippingOrderRequest.dtd" PUBLIC "SYSTEM">

My vba program to call source xml and xslt given below, Sub dummy() Call Transform("C:\Users\nypaul\Desktop\XMLTESTING\SOURCE\01_open_file_20180606_093719_1135.xml", "C:\Users\nypaul\Desktop\XMLTESTING\abc.xsl", "C:\Users\nypaul\Desktop\testing\out\01_open_file_180428_045209_10213.xml")

MsgBox "ok"

End Sub

Function Transform(sourceFile, styleSheetFile, resultFile) As Boolean

Dim Source As Object Dim StyleSheet As Object Dim Result As Object

Set Source = CreateObject("MSXML2.DOMDocument") Set StyleSheet = CreateObject("MSXML2.DOMDocument") Set Result = CreateObject("MSXML2.DOMDocument")

On Error GoTo TheEnd

Transform = True

' Load data. Source.async = False Source.Load sourceFile

' Load style sheet. StyleSheet.async = False StyleSheet.Load styleSheetFile

' Do the transformation Source.transformNodeToObject StyleSheet, Result Result.Save resultFile

' Transformation done, exit normally Exit Function TheEnd: ' If an error occured, return False Transform = False

End Function …
0
I can't add font property into property grid through xml.
it's show serialization error. how to do this vb.net ?

Private _windowFont As Font = New Font("Arial", 8, FontStyle.Regular)
   Public Property FontName() As Font
       Get
           Return _win[embed=file 1328036]dowFont
        End Get
        Set(ByVal Value As Font)
            _windowFont = Value
        End Set
    End Property

Open in new window

0
Can XSLT 3.0 recover from an error and continue like other languages can?

I'm editing some XSLT 3.0 code, and running some large projects through it, which goes through many files and processes them, and all goes well for a while, but eventually it complains about some small little thing, like it can't find one file out of a thousand, or an empty sequence was passed to function IsEmptyDoc(), and the whole thing quits.

And I'm thinking, Wouldn't it be nice if it could recover from a little thing like this and continue?

Is that possible in XSLT 3.0?

Like it is in other programs that have try-catch blocks?

Where if something goes wrong, just say OK, small problem, but let's at least give the user what we've got so far, and at least do what we can, rather than just immediately stop and give up.
0
I am just learning Xpath and I hope this is possible.

I have this XML input and need to write the same output while populating the HL_734 with the value of it's 'parent' group in the hierarchy.  The Items levels belong to the preceding Tare level and the Tare levels belong to the preceding Shipment. I hope my diagram makes it clear.

So to read the preceding HL_628 when I come to the next HL_734 it seems that the 'preceding' axis is made for this.  But no matter my syntax I get the '1' in all of my HL_734's or I get nothing.   I have several hundred pages of reference materials but hoped someone could point me in the right direction since I am making no progress.

            <xsl:element name="HL_734">
               <xsl:value-of select="preceding::*/HL_628 [last()]"/>
            </xsl:element>

 

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<ACTIS>
   <SG0>
      <G_SG0>
         <S_DTM_1_300/>
         <G_HL>
            <S_HL>
               <idHL>HL</idHL>
               <HL_628>1</HL_628>
               <HL_734/>                                    <- Shipment level has no parent
               <HL_735>S</HL_735>
               <HL_736/>
            </S_HL>
            <S_REF_2_1900/>
            <S_DTM_2_3500/>
         </G_HL>
         <G_HL>
            <S_HL>
               <idHL>HL</idHL>
               <HL_628>2</HL_628>
               <HL_734/>                        <- This needs to be populated from the Shipment HL_628 above with value '1'
               …
0

XML

20K

Solutions

13K

Contributors

Extensible Markup Language (XML) refers to the encoding of documents such that they can be read by both machines and humans. XML documents use tags to show the beginning and end of a set of data. XML is used extensively on websites to show volumes of data, and is the default for a number of office productivity suites. This topic includes discussions of XML-related technologies, such as XQuery (the XML Query language), XPath (the XML Path language), XSLT (eXtensible Stylesheet Language Transformations), XLink (the XML Linking language) and XPointer (the XML Pointer language).