cancel
Showing results for 
Search instead for 
Did you mean: 

Get via XPATH to value of the tag

former_member373665
Participant
0 Kudos

HI experts!

I have a doubt about XSLT. I'm trying get via XPATH to value of the tag <Nombre> but I don't know how can I do it.

I'm tryng acces with this XPTAH:

<xsl:copy-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role=&apos;C&apos; and ./@id=&apos;atom1&apos;]/*/Table1/Nombre">

but it's impossible.

I also tried with code:


<xsl:copy-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role=&apos;C&apos; and ./@id=&apos;atom1&apos;]/DescargarFicheroPendienteResponse/DescargarFicheroPendienteResult/Table1/Nombre">

I think th problem is the tag:

<Payload Role="C" id="atom1" statusNo="0" statusMsg="success" reference="atom2" payload="atom2" calltype="solicit response (call/reply)" adapter="WSAS">


This is the XML:

<Payload Role="C" id="atom1" statusNo="0" statusMsg="success" reference="atom2" payload="atom2" calltype="solicit response (call/reply)" adapter="WSAS">

    <http.header>

        <http.header.info id="X-AspNet-Version" value="2.0.50727"/>

        <http.header.info id="Date" value="Wed, 24 Jul 2013 10:23:53 GMT"/>

        <http.header.info id="Content-Length" value="494"/>

        <http.header.info id="MicrosoftOfficeWebServer" value="5.0_Pub"/>

        <http.header.info id="Content-Type" value="text/xml; charset=utf-8"/>

        <http.header.info id="Server" value="Microsoft-IIS/6.0"/>

        <http.header.info id="X-Powered-By" value="ASP.NET"/>

        <http.header.info id="Cache-Control" value="private, max-age=0"/>

    </http.header>

    <DescargarFicheroPendienteResponse xmlns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

        <DescargarFicheroPendienteResult>

            <NewDataSet xmlns="">

                <Table1>

                    <Nombre>0</Nombre>

                    <Contenido/>

                </Table1>

            </NewDataSet>

        </DescargarFicheroPendienteResult>

    </DescargarFicheroPendienteResponse>

</Payload>

anyone can help me?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mariano.

I think you forget the node NewDataSet...

Try this ...../DescargarFicheroPendienteResult/NewDataSet/Table1/Nombre">

Regards!

former_member373665
Participant
0 Kudos

HI Antonio,

thank you for your reply.

You have reason when you say I forgot the  'NewDaraSet' tag,

but that is not the problem. I think my problem is about the namespace xmlns="http://tempuri.org/", but I don't know how can I solve it.

I have read I have to rename  stylesheet but when test the step occurs an error:

<xsl:stylesheet xmlns:b1e="urn:com.sap.b1i.sim:b1event"

xmlns:b1ie="urn:com.sap.b1i.sim:b1ievent"

xmlns:b1im="urn:com.sap.b1i.sim:b1imessage"

xmlns:bfa="urn:com.sap.b1i.bizprocessor:bizatoms"

xmlns:jdbc="urn:com.sap.b1i.adapter:jdbcadapter"

xmlns:rfc="urn:sap-com:document:sap:rfc:functions"

xmlns:sim="urn:com.sap.b1i.sim:entity"

xmlns:utils2="com.sap.b1i.bpc_tools.Utilities"

xmlns:vpf="urn:com.sap.b1i.vplatform:entity"

xmlns:xci="urn:com.sap.b1i.xcellerator:intdoc"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:po="http://tempuri.org/"

..............>

xmlns:po="http://tempuri.org/"


com.sap.b1i.utilities.UtilException: UTE001 Nested exception: javax.xml.transform.TransformerConfigurationException: Could not load stylesheet.com.sap.engine.lib.xml.util.NestedException: Prefix not mapped: po -> java.lang.Exception: XMLParser: Prefix 'po' is not mapped to a namespace

Do you know what can i do?

Regards.

bastian_schaefer
Active Contributor
0 Kudos
Hi,
in the INBOUND definition of your scenario step, you can define the additional namespaces you need.
Just edit your xform atom via graphical integration flow and check if the new namespace was copied into stylesheet segment.
just use the namespace alias you defined in the INBOUND definition:
<xsl:copy-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role=&apos;C&apos; and ./@id=&apos;atom1&apos;]/ttt:DescargarFicheroPendienteResponse/*"/>
Are you sure you want to use copy-of? If you need to fill only a value please use value-of.
Copy-of is normally used to copy complete subsegments
The opther option is of course to ignore the namespaces in your XSLT code using
/*[local-name()=&apos;DescargarFicheroPendienteResponse&apos;]
Best regards
Bastian
former_member373665
Participant
0 Kudos

thank you very much

Answers (0)