Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8665861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:35:19+00:00 2026-06-12T17:35:19+00:00

I have the following snippet of XML: <?xml version=1.0 encoding=UTF-8?> <Envelope xmlns=http://schemas.microsoft.com/dynamics/2008/01/documents/Message> <Header> <MessageId>{11EA62F5-543A-4483-B216-91E526AE2319}</MessageId>

  • 0

I have the following snippet of XML:

<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/Message">
  <Header>
    <MessageId>{11EA62F5-543A-4483-B216-91E526AE2319}</MessageId>     
    <SourceEndpoint>SomeSource</SourceEndpoint>
    <DestinationEndpoint>SomeDestination</DestinationEndpoint>
  </Header>
  <Body>
    <MessageParts xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/Message">
      <SalesInvoice xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/SalesInvoice">
        <DocPurpose>Original</DocPurpose>
        <SenderId>Me</SenderId>
        <CustInvoiceJour class="entity">
          <_DocumentHash>ddd70464452c64d5a35dba5ec50cc03a</_DocumentHash>              
          <Backorder>No</Backorder>
        </CustInvoiceJour>
      </SalesInvoice>
    </MessageInvoice>
  </Body>
</Envelope>

As you can see, this uses multiple namespaces so when I want to transform this using XSL, I’m not sure which namespace I should be using as I need to gather some information from the Header tag and the SalesInvoice tag.

Here is my XSL file:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xheader="http://schemas.microsoft.com/dynamics/2008/01/documents/Message" 
    exclude-result-prefixes="xheader"
>
  <xsl:output method="xml" indent="yes" />
  <xsl:template match="/">
    <header>
      <name><xsl:value-of select="/*/*/xheader:SourceEndpoint" /></name>
    </header>
    <body>
      <test><xsl:value-of select="/*/*/*/*/*/xheader:Backorder" /></test>
    </body>
  </xsl:template>
</xsl:stylesheet>

In the transformed document, the SourceEndpoint is populated but the Backorder isn’t, because it uses a different namespace. So how can I make it use the different namespace?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:35:20+00:00Added an answer on June 12, 2026 at 5:35 pm

    You should just have to declare and use both namespaces in your xslt:

    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:xheader="http://schemas.microsoft.com/dynamics/2008/01/documents/Message"
        xmlns:xsales="http://schemas.microsoft.com/dynamics/2008/01/documents/SalesInvoice" 
        exclude-result-prefixes="xheader xsales"
    >
      <xsl:output method="xml" indent="yes" />
      <xsl:template match="/">
        <header>
          <name><xsl:value-of select="/*/*/xheader:SourceEndpoint" /></name>
        </header>
        <body>
          <test><xsl:value-of select="/*/*/*/*/*/xsales:Backorder" /></test>
        </body>
      </xsl:template>
    </xsl:stylesheet>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following manifest (snippet): <?xml version=1.0 encoding=utf-8?> <manifest xmlns:android=http://schemas.android.com/apk/res/android android:versionCode=1 android:versionName=1.0 package=com.uniquename.appname>
I have the following snippet: <?xml version=1.0 encoding=UTF-8?> <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0
I have the following xml snippet: <?xml version=1.0 encoding=UTF-8 ?> <!DOCTYPE sqlMap PUBLIC -//ibatis.apache.org//DTD
I have the following XML snippet: <?xml version=1.0 encoding=utf-8?> <dmFiles> <dmFile dmUpFileGuid= dmFileDescr=testcase01.pdf dmFileMetaType=main
I have an xml that has nested tags like the following: <?xml version=1.0 encoding=utf-8
I have a xml file which has the following header: <?xml version=1.1 encoding=UTF-8?> .
I've coded this small snippet to show what I'm not understanding: <?xml version=1.0 encoding=utf-8?>
I have the following code snippet in my feature.xml <Feature Id=0c272f81-49c0-440a-a544-677d51a8ffe4 ReceiverAssembly=FeaturedMasterPage, Version 1.0.0.0,
I have the following snippet in my pom.xml (Full pom attached below which can
I have the following xml snippet <ZMARA01 SEGMENT=1> <CHARACTERISTICS_01>X,001,COLOR_ATTRIBUTE_FR,BRUN ÉCORCE,TMBR,French C</CHARACTERISTICS_01> <CHARACTERISTICS_02>X,001,COLOR_ATTRIBUTE,Timber Brown,TMBR,Color Attr</CHARACTERISTICS_02>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.