0

I have a problem with XSLT Transformation.

I have an XML:

<?xml version="1.0" encoding="UTF-8"?>
<parser xmlns="http://www.dabgps.nxp">
  <bash>
    <![CDATA[
      # MAIN VARIABLES
     bash
    ]]>
  </bash>

  <bbb>
    <![CDATA[
      # MAIN VARIABLES
      bbb
    ]]>
  </bbb>

  <bash>
    <![CDATA[
      # MAIN VARIABLES
      bash
    ]]>
  </bash>
</parser>

And I have a XSD:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="text" indent="yes"/>

<xsl:template match="parser">

  <xsl:value-of select="bbb"/>

</xsl:template>

</xsl:stylesheet>

The problem I get every time a result:

  # MAIN VARIABLES
  bash





  # MAIN VARIABLES
  bbb





  # MAIN VARIABLES
  bash

What I expect is of course only:

  # MAIN VARIABLES
  bbb

Doesn't matter which or it is. The XSLT processor print out all the stuff I have in CDATA Tag, even if it is not in the matched template (seems just to get CDATA out of the document) What could be here wrong?

1 Answer 1

1

I think the issue is here related to namespace http://www.dabgps.nxp defined in your XML file. There is a similar thread that is explaining about this here.

xsl:template match doesn't find matches

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.