Results 1 to 1 of 1
  1. #1
    JohanG is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2022
    Posts
    14

    XSL Transform XML to XML Syntax to copy an attribute and its value

    Afternoon,



    I have the following code sniplet in my xsl file that is returning an empty value for <DocumentNumberCopy>:

    Code:
    <AgentInvoiceLineCollection>
    <xsl:for-each select="./AgentInvoiceLineCollection/AgentInvoiceLine"> <AgentInvoiceLine>
    <DocumentNumberCopy>
    <xsl: value-of select=".DocumentNumber"/>
    </DocumentNumberCopy> <LineNumber>
    <xsl:value-of select="./LineNumber"/>
    </LineNumber>

    XML Tree:


    XMLLandedCostingOutput
    MessageInfo
    ShipmentDetails
    AgentInvoiceCollection
    AgentInvoice
    DocumentType
    DocumentNumber
    DocumentDate
    AgentInvoiceLine
    DocumentNumberCopy


    Looking for the correct xsl syntax that will copy (add) an attribute "DocumentNumber" and it's value (sitting below "AgentInvoice") to attribute "DocumentNumberCopy" under "AgentInvoiceLine".

    I have also attached an image to try and explain.

    Apologies if my XML terminology is not correct; pretty clueless when it comes to XML.

    Your assistance much appreciated.
    Attached Thumbnails Attached Thumbnails XML_Tree.jpg  

Please reply to this thread with any new information or opinions.

Similar Threads

  1. PtrSave attribute
    By hemaazez in forum Access
    Replies: 6
    Last Post: 01-16-2018, 03:13 AM
  2. Manually changing attribute
    By michaeljohnh in forum Programming
    Replies: 4
    Last Post: 09-14-2010, 12:50 PM
  3. How to access the description attribute
    By joethall in forum Access
    Replies: 1
    Last Post: 06-08-2010, 03:05 PM
  4. Replies: 5
    Last Post: 05-05-2010, 04:31 PM
  5. Unnhide Attribute?
    By thorsonb in forum Access
    Replies: 1
    Last Post: 03-30-2010, 10:21 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums