$(function () { pageContext.i18n.modTalk = 'moderation talk'; pageContext.i18n.replyToComment = 'Reply'; pageContext.i18n.modTalkEmpty = 'moderation talk is empty'; pageContext.url.getModTalk = "/comments/%25ID%25/listModTalk.json"; pageContext.url.possibleCommentRecipients = "/comments/%ID%/possibleRecipients.json"; pageContext.url.commentEdit = '/comments/%25ID%25/edit.html'; pageContext.url.commentView = '/comments/%ID%/view.html'; pageContext.i18n.commentVisibility = { 'full': 'Viewable by all users', 'op': 'Viewable by the original poster', 'mod': 'Viewable by moderators', 'opAndMod': 'Viewable by moderators and the original poster', 'other': 'Advanced visibility', 'dialogTitle': 'Comment visibility', 'selectGroups': 'Visible to groups', 'selectOther': 'Other recipients', 'selectOriginalPoster': 'Original poster', 'selectModerators': 'Moderators', 'selectAssignees': 'Asked to answer users' }; pageContext.i18n.commentMenuLabels = { 'comment-edit': 'comments.menu.edit', 'comment-delete': 'comments.menu.delete', 'comment-convert': 'comments.menu.convert' };pageContext.i18n.answer= { bestAnswer: 'Best Answer', controlBar : { accept: 'Accept', unaccept: 'Unaccept', acceptCommand: 'Accept this answer as correct', cancelAcceptedCommand: 'Remove this answers accepted status' } }; window.croles = { u: false, op: false, m: false, og: false, as: false, ag: false, dc: false, doc: false, eo: false, ea: false }; tools.init({ q: { e: false, ew: false, eo: false, r: false, ro: false, d: false, dow: false, fv: false, c: false, co: false, p: false, tm: false , ms: false, mos: false }, n: { f: false, vf: false, vfo: false, vr: true, vro: true, c: false, co: false, vu: false, vd: false, w: false, wo: false, l: false }, c: { e: false, eo: false, d: false, dow: false, ta: false, tao: false, l: false }, a: { e: false, ew: false, eo: false, d: false, dow: false, a: false, aoq: false, ao: false, tc: false, tco: false, p: false, tm: false }, pc: croles }, { tc: true, nsc: true }); commandUtils.initializeLabels(); }); Skip to Content

Handling xml:lang tag in cXML for Ariba

Hi All,

I have created scenario to push cXML to Ariba.

Ariba expects a tag in the format xml:lang (mentioned below)but HCI generates only as lang which cause message failure while pushing message to ariba.

Expected: <Description xml:lang="en"/>

Generated: <Description lang="en"/>

WSDL reference used in HCI mapping:

<xsd:element name="Description" form="qualified">

<xsd:complexType>

<xsd:simpleContent>

<xsd:extension base="xsd:string"><xsd:attribute ref="xml:lang"/></xsd:extension>

Please let me know how to achive it.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Mar 08, 2017 at 12:25 PM

    Hi All,

    Can you please let me know if you have any XSL code to achieve it?

    Regards,

    Mani

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 08, 2017 at 12:59 PM

    Hello Mani,

    It would be great if you can paste or attach the XML ( Expected and Generated ) so that it will be easier to give some solution on that.

    Regards,

    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 09, 2017 at 05:46 AM

    Hi Prasad,

    Please find input and output xml. As this is required for HCI, I am fine to go with XSLT, groovy or javascript to achieve this.

    For example:

    Input:

        <?xml version="1.0" encoding="UTF-8"?>
        <root>
        <Description lang="en">TEST</Description>
        <Forecast>
        <Period endDate="2016-09-01T23:59:59+02:00" startDate="2016-09-01T00:00:00+02:00"/>
        <ForecastQuantity quantity="34.0">
        <name lang="en">TEST1</name>
        <UnitOfMeasure>EA</UnitOfMeasure>
        </ForecastQuantity>
        </Forecast>
        </root>

    Output:

        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.029/cXML.dtd">
        <root>
        <Description xml:lang="en">TEST</Description>
        <Forecast>
        <Period endDate="2016-09-01T23:59:59+02:00" startDate="2016-09-01T00:00:00+02:00"/>
        <ForecastQuantity quantity="34.0">
        <name xml:lang="en">TEST1</name>
        <UnitOfMeasure>EA</UnitOfMeasure>
        </ForecastQuantity>
        </Forecast>
        </root>
    Add comment
    10|10000 characters needed characters exceeded

  • Mar 17, 2017 at 07:53 AM

    Hello Mani,

    Below XSLT will do the requirement.

    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:template match="node()|@*">
            <xsl:copy>
                <xsl:apply-templates select="node()|@*"/>
            </xsl:copy>
        </xsl:template>
        <xsl:template match="@lang">
            <xsl:attribute name="xml:lang">
                <xsl:value-of select="."/>
            </xsl:attribute>
        </xsl:template>
    </xsl:stylesheet>


    Regards,

    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded