How to customize attribute in root element?

I'm using TSQL to generate an XML file from a SELECT query.  I'm 99% of the way to creating the precise format the client requires.  Here's the top portion of what I currently have:
<Feed>
<Interaction>
<TransactionDate>2012-01-17T19:18:26.703</TransactionDate>
The ONLY thing I want to change is to add an attribute to the root element so that things look like this:
<Feed xmlns="http://www.bazaarvoice.com/xs/PRR/PostPurchaseFeed/5.6">
<Interaction>
<TransactionDate>2012-01-17T19:18:26.703</TransactionDate>
That's it.  But I've read 20+ different discussions about this and nothing works.
Might anyone have a solution?
Robert W.

Hi,
Maybe you can refer to the following URL,
to try to solve your questions.
http://stackoverflow.com/questions/12726426/tsql-for-xml-add-schema-attribute-to-root-node
| SQL PASS Taiwan Page |
SQL PASS Taiwan Group
|
My Blog

Similar Messages

  • How to insert multiple attributes to root elements

    Hi,
    I have to costruct a request to a service in which all the multipul ements shold be populated as attributes.
    The elements should be retrived from response from an intermediate service callout.
    Is there any function to do that..

    Try this. Be careful that your element does not go deeper than 1 desendant or else you will get concatenating data.
    for $mydoc in $root
    return element { node-name($mydoc) } (: element constructor notation :)
    { $mydoc/@*, (:add existing attributes :)
         for $el in $mydoc/* (: element constructor sub-nodes :)
    return attribute {local-name($el)}{data($el)}
    I used http://www.xqueryfunctions.com/xq/functx_add-attributes.html as a guide.

  • How can i change the ROOT ELEMENT name in my ADOBE Form

    Hello All,
    I need to change "data" the Root Element default name to another name.
    Is this possible? How do i do this?
    Thank you all in advance,
    Eran

    Hello Chintan and Otto,
    thank you for your replies...
    Chintan: There is Adobe livecycle designer CE and its a stand alone application :[ designer CE2|http://www.adobe.com/products/livecycle/]
    Otto: I know i can send the xml back and change it in my abap program but i'm talking about stand alone form in a computer with no sap on it.
    The user will fill it and submit it ...
    Thank you all in advance,
    Eran

  • How to remove namespace from root-element

    Hi Gurus,
    I want one xml output from xslt transformation with no namespace. I managed to remove namespace from child elements by leveraging elementFormDefault ='unqualified' property of xsd. But not able remove namespace from root-element.
    Output that I want is :
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <inp1:Email_Mod_Root>
       <Email_Mod_Root_Element>
          <Email_Record1>
             <PERSON_NUMBER>123456</PERSON_NUMBER>
             <COUNTRY/>
              <EMAIL_TYPE>WORK</EMAIL_TYPE>
             <EMAIL>EMAIL3</EMAIL>
             <PRIMARY_FLAG>Y</PRIMARY_FLAG>
          </Email_Record1>
    </Email_Mod_Root_Element>
    </Email_Mod_Root>
    Output that I am getting:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <inp1:Email_Mod_Root xmlns:inp1="http://www.example.org">
       <Email_Mod_Root_Element>
          <Email_Record1>
             <PERSON_NUMBER>123456</PERSON_NUMBER>
             <COUNTRY/>
             <EMAIL_TYPE>WORK</EMAIL_TYPE>
             <EMAIL>EMAIL3</EMAIL>
             <PRIMARY_FLAG>Y</PRIMARY_FLAG>
          </Email_Record1>
    </Email_Mod_Root_Element>
    </Email_Mod_Root>
    Anyone, pls suggest.
    Thanks in advance,
    SG_SOA

    First of all :
    <inp1:Email_Mod_Root>
       <Email_Mod_Root_Element>
          <Email_Record1>
             <PERSON_NUMBER>123456</PERSON_NUMBER>
             <COUNTRY/>
              <EMAIL_TYPE>WORK</EMAIL_TYPE>
             <EMAIL>EMAIL3</EMAIL>
             <PRIMARY_FLAG>Y</PRIMARY_FLAG>
          </Email_Record1>
    </Email_Mod_Root_Element>
    </Email_Mod_Root>
    isn't valid xml (you start with inp1: prefix and you end the tag with no prefix, but let's assume you don't want any prefix/namespace at all)
    if i use :
    [code]
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:inp1="http://www.example.org" exclude-result-prefixes="inp1">
      <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="*">
        <xsl:element name="{local-name(.)}">
          <xsl:apply-templates select="@* | node()"/>
        </xsl:element>
      </xsl:template>
      <xsl:template match="@*">
        <xsl:attribute name="{local-name(.)}">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:template>
    </xsl:stylesheet>
    [/code]
    i get this
    [code]
    <Email_Root_Element>
      <Email_Record>
      <EMPLID>EMPLID46</EMPLID>
      <EMAIL>EMAIL48</EMAIL>
      <E_ADDR_TYPE>E_ADDR_TYPE49</E_ADDR_TYPE>
      <COUNTRY>US</COUNTRY>
      </Email_Record>
      <Email_Record>
      <EMPLID>EMPLID47</EMPLID>
      <EMAIL>EMAIL49</EMAIL>
      <E_ADDR_TYPE>E_ADDR_TYPE50</E_ADDR_TYPE>
      <COUNTRY>US</COUNTRY>
      </Email_Record>
      <Email_Record>
      <EMPLID>EMPLID48</EMPLID>
      <EMAIL>EMAIL49</EMAIL>
      <E_ADDR_TYPE>E_ADDR_TYPE51</E_ADDR_TYPE>
      <COUNTRY>US</COUNTRY>
      </Email_Record>
    </Email_Root_Element>
    [/code]

  • How to add attribute to the elements in XML file in BPEL transformation

    Hi All-
    I have to create a XML file using transformation and file adapater and the parent element is USERRECORDS, now when I am creating the XML file using transformation the XML get creates like
    <?xml version="1.0">
    <USERRECORDS>
    so on
    But I want the parent element and the xml version tags as:
    <?xml version="1.0" encoding="UTF-8"?>
    <USERRECORDS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="mySchema.xsd">
    as I need to add the attributes.
    Is it possible in transformation?
    Any idea, please suggest.
    Thanks and Regards,
    Sreejit

    I have never come across any functionality like that.
    However I assigned values to attributes in Assign Acitivity using XML Fragment on source side.

  • How to order root element's attributes?

    Hi, there:
    I am using the following DOM code to create a root element and set its attributes:
    // add root element
            org.w3c.dom.Element root = doc.createElementNS( "http://www.w3.org/2001/XMLSchema",
                    "xsd:root" );
            root.setAttribute( "targetNamespace", "http://www.w3.org/2001/XMLSchema" );
            root.setAttribute( "elementFormDefault", "qualified" );
            root.setAttribute( "attributeFormDefault", "unqualified" );
            root.setAttribute( "version", "1.2" );
            doc.appendChild( root );Generated results look like this:
    <xsd:root attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.plmxml.org/Sample" version="1.2" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
    It seems the order of attributes does not exactly follow the above code.
    what I want is the following:
    <xsd:root xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.plmxml.org/Sample" attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.2"/>
    I am wondering how I can order them?
    thanks,

    The XML specs say that there is no requirement for any programs that process XML to care about the order of attributes. They are an unordered lot.
    If you try other DOM-ish processors you may find one that does what you want, but it might change in the future.
    No program should rely on the sequence of attributes.
    Dave Patterson

  • Create Root Element in XML

    Hi Experts,
    I am develpoing a program to generate xml file as output. I am using the method CL_IXML and other interfaces to generate the xml data. Here I need to create a root element. I did search in SDN but I couldnot found anything to generate xml root element.
    My output should be like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <Request Version="11.1" IssuerID="1">
            <CreatePurchaseRequest
                RequestID="123456"
                Commonname="test"
            </CreatePurchaseRequest>
    </Request>
    Can anybody plz suggest how can I generate the root element Request here?
    Regards,
    Ranganadh.

    Thanks Sandra,
    My issue got resolved.
    I just created the root element using the method create_sample_element and set the attributes using set_attributes method.
    Thanks for your help.
    w_ixml = cl_ixml=>create( ).
          w_document = w_ixml->create_document( ).
          w_root = w_ixml->create_document( ).
          IF w_document IS INITIAL.
            RAISE EXCEPTION TYPE cx_cmx_da_exception
              EXPORTING
                textid = cx_cmx_da_exception=>cx_cmx_da_error_internal.
          ENDIF.
          w_encoding = w_ixml->create_encoding(
                                 character_set = 'utf-8'
                                 byte_order    = if_ixml_encoding=>co_none ).
          w_document->set_encoding( w_encoding ).
          w_element_inv1  = w_document->create_simple_element(
                      name = 'OrbiscomRequest'
                      parent = w_document ).
          w_element_inv1->set_attribute( name = 'Version'
                                         namespace = ''
                                         value = '11.1' ).
          w_element_inv1->set_attribute( name = 'IssuerID'
                                         namespace = ''
                                         value = '1' ).

  • Namespace prefix in Root element missing during variable assignment in SOA Suite 11g

    I need qualified element Namespaces in one of the target variables. All elements being referred to would have the namespace prefixed. This is working for all child elements, but not the for root element. How can i get the root element prefixed with the namespace?
    We are using SOA Suite 11g and the Jdeveloper version we are using is 11.1.1.6.0
    when i use transform operation to populate the target variable the variable gets populated something like this :
    <inputVariable>
    <part  name="payload">
    <Message>
    <msg:Header>
    <head:field1>xxxxxx</head:field1>
    <head:field2>2013-07-09T08:00:55</head:field1>
    </msg:Header>
    </Message>
    But the actual output we need is
    <inputVariable>
    <part  name="payload">
    <msg:Message>
    <msg:Header>
    <head:field1>xxxxxx</head:field1>
    <head:field2>2013-07-09T08:00:55</head:field1>
    </msg:Header>
    </msg:Message>
    We tried the fix suggested in one of the SOA threads but its not working for us and looks like that will work only for SOA SUITE 10g.
    Please provide us any help/suggestions if anyone know the solution.
    Thank you in advance for the help.

    Any one can help us please.......

  • Namespace prefix in Root element missing during variable assignment

    In bpel 10.1.3.4, I need qualified element Namespaces in one of the target variables. I have an xsd that has elementFormDefault = "qualified" set, therefore all elements being referred to would have the namespace prefixed. This is working for all child elements, but not the root element. How can i get the root element prefixed with the namespace?
    If i use transform or copy/append operation to populate in the target variable the variable gets populated something like this :
    <Invoice xmlns:pidx="http://www.api.org/pidXML/v1.0" pidx:transactionPurposeIndicator="Original" pidx:version="1.0" xmlns="http://www.api.org/pidXML/v1.0">
    <pidx:InvoiceProperties>
    <pidx:InvoiceNumber>test123</pidx:InvoiceNumber>
    </pidx:InvoiceProperties>
    </Invoice>
    Whereas i need :
    <*pidx:*Invoice xmlns:pidx="http://www.api.org/pidXML/v1.0" pidx:transactionPurposeIndicator="Original" pidx:version="1.0" xmlns="http://www.api.org/pidXML/v1.0">
    <pidx:InvoiceProperties>
    <pidx:InvoiceNumber>test123</pidx:InvoiceNumber>
    </pidx:InvoiceProperties>
    </*pidx:*Invoice>
    Is there some way to accomplish this?
    Regards,
    Sandeep

    Hi Sandeep,
    We have exactly the same issue, but, when we implemented the solution, we are getting the following error, when we tried to compile the code, we are using 11.1.1.4.0 version of SOA 11g, appreciate if there is any way you can help us on this:
    Jul 12, 2011 2:40:28 PM com.collaxa.cube.CubeLogger info
    INFO: validating "BPELProcess1.bpel" ...
    oracle.jrf.UnknownPlatformException: JRF is unable to determine the current application server platform.
         at oracle.jrf.ServerPlatformSupportFactory.getInstance(ServerPlatformSupportFactory.java:79)
         at oracle.integration.platform.blocks.WLSPlatformConfigurationProvider.<clinit>(WLSPlatformConfigurationProvider.java:44)
         at oracle.integration.platform.blocks.FabricConfigManager.<clinit>(FabricConfigManager.java:154)
         at oracle.integration.platform.blocks.xpath.FabricXPathFunctionResolver.loadXpathFunctions(FabricXPathFunctionResolver.java:282)
         at oracle.integration.platform.blocks.xpath.FabricXPathFunctionResolver.loadXPathConfigFile(FabricXPathFunctionResolver.java:156)
         at oracle.integration.platform.blocks.xpath.FabricXPathFunctionResolver.init(FabricXPathFunctionResolver.java:49)
         at com.collaxa.cube.xml.xpath.BPELXPathFunctionNameResolver.loadFabricXpathFunctions(BPELXPathFunctionNameResolver.java:57)
         at com.collaxa.cube.xml.xpath.BPELXPathFunctionNameResolver.<init>(BPELXPathFunctionNameResolver.java:48)
         at com.collaxa.cube.xml.xpath.BPELXPathFunctionNameResolver.<clinit>(BPELXPathFunctionNameResolver.java:44)
         at com.collaxa.cube.lang.compiler.bpel.XPathExprValidatorVisitor.<init>(XPathExprValidatorVisitor.java:122)
         at com.collaxa.cube.lang.compiler.bpel.AssignValidator.<init>(AssignValidator.java:89)
         at com.collaxa.cube.lang.compiler.bpel.BpelParser.<init>(BpelParser.java:452)
         at com.collaxa.cube.lang.compiler.bpel.BPELValidator.validate(BPELValidator.java:60)
         at com.collaxa.cube.lang.compiler.BPEL1Processor.validate(BPEL1Processor.java:329)
         at com.collaxa.cube.lang.compiler.BPEL1Processor.process(BPEL1Processor.java:153)
         at com.collaxa.cube.lang.compiler.CubeParserHelper.compile(CubeParserHelper.java:47)
         at oracle.fabric.bpel.bpelc.BPELComponentValidator.validate(BPELComponentValidator.java:40)
         at oracle.soa.scac.ValidateComposite.validateComponentTypeServicesReferences(ValidateComposite.java:1117)
         at oracle.soa.scac.ValidateComposite.doValidation(ValidateComposite.java:500)
         at oracle.soa.scac.ValidateComposite.run(ValidateComposite.java:150)
         at oracle.soa.scac.ValidateComposite.main(ValidateComposite.java:135)
    Jul 12, 2011 2:40:29 PM CubeProcessGenerator compile
    WARNING: classpath is: C:\oracle\Middleware\jdeveloper\jdev\extensions\oracle.sca.modeler.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.mgmt_11.1.1\soa-infra-mgmt.jar;C:\oracle\Middleware\oracle_common\modules\oracle.fabriccommon_11.1.1\fabric-common.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.mediator_11.1.1\mediator_client.jar;C:\oracle\Middleware\oracle_common\modules\oracle.mds_11.1.1\mdsrt.jar;C:\oracle\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;C:\oracle\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xml.jar;C:\oracle\Middleware\jdeveloper\jdev\extensions;;C:\JDeveloper\mywork\InvoiceTransferApp\InvoiceTransferProj\SCA-INF\classes;C:\JDeveloper\mywork\InvoiceTransferApp\InvoiceTransferProj\SCA-INF\classes;C:\JDeveloper\mywork\InvoiceTransferApp\InvoiceTransferProj\SCA-INF\gen-classes;C:\oracle\Middleware\oracle_common\modules\commonj.sdo_2.1.0.jar;C:\oracle\Middleware\oracle_common\modules\oracle.fabriccommon_11.1.1\fabric-common.jar;C:\oracle\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\bpel1-1-xbeans.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-common.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\bpel_coherence_config.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-exts.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\thirdparty.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\bpm-analytics.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-thirdparty.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\wsif-binding.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-validator.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\monitor-rt-xbean.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\oracle.soa.bpmn.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel1.jar;C:\oracle\Middleware\jdeveloper\soa\modules\user-patch.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.thirdparty.jar;C:\oracle\Middleware\jdeveloper\uddi\lib\oracle.soa.uddi.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\bpm-infra.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\testfwk-xbeans.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-ext.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\soa-infra-scheduler.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\xmlunit-1.1.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\soa-infra-tools.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\soa-xpath-exts.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\oracle-soa-client-api.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.wls.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-client.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime-ext-was.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime-ext-wls.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\oracle.soa.fabric.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.ext_11.1.1\classes
    Regards,
    Sireesh

  • How to Customize the Web item " Text Elements"in WAD

    Hi All,
    Can any one let me know how to customize the web item TEXT ELEMENTS. When we place the web item Text element in the web template, it displays the query details and the info provider details.
    I question is I do not want to list all the list that is displayed in the text elements. I want to see only part of the list....can any one whether this is possible or not..if possible how...?
    Thanks in Advance,
    Hash

    yes you need to specify the variable name
    <object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="GET_ITEM"/>
             <param name="NAME" value="TEXTELEMENTS_1"/>
             <param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_TEXT_ELEMENTS"/>
             <param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
             <param name="GENERATE_CAPTION" value="BORDER"/>
             <param name="GENERATE_LINKS" value=""/>
             <param name="SHOW_COMMON_ELEMENTS" value=""/>
            <b> <param name="ELEMENT_TYPE_1" value="VARIABLE"/>
             <param name="ELEMENT_NAME_1" value="0H_CCTR"/></b>         ITEM:            TEXTELEMENTS_1
    </object>
    Regards
    Raja

  • 'ResourceDictionary' root element is a generic type and requires a x:Class attribute to support the x:TypeArguments attribute sp

    Error : 'ResourceDictionary' root element is a generic type and requires a x:Class attribute to support the x:TypeArguments attribute specified on the root element tag.
    Hi,
    I get this error when i include some namespaces in my ResourceDictionary to specify a Style for a custom control.
    Can anyone help me?
    Thx
    Stardusty

    Hi,
    That's the whole point. I don't want to use x:TypeArguments on a ResourceDictionary but the compiler says it needs it.
    And i don't know why.
    This code give no error:
    <ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespaceystem;assembly=mscorlib">  
    </ResourceDictionary>
    And by adding 3 namespaces it gives that weard error:
    <ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="clr-namespace:MyTime.View.Controls"
    xmlns:converters="clr-namespace:MyTime.View.Converters"
    xmlns:validationrules="clr-namespace:MyTime.View.ValidationRules"
    xmlns:sys="clr-namespaceystem;assembly=mscorlib">  
    </ResourceDictionary>

  • How to change general attribute of text element

    hi
    who now how to change general attribute of text element on screen dinamically? I wish to change text value dinamically for example.

    Hi Denis,
    I am not too sure on what you want.
    If you require that the text value be different based on some conditions you can declare as many text elements as conditions and call the relevant text element.
    But I dont think that you can assign dynamic texts to a single text element.
    Regards,
    Saurabh

  • How to use SAX Parseto paser xml without root element

    Hello,
    I have big a xml file(500M) with without root element. How can I use SAXParse to parse it.

    A well-formed XML file has a single root element. Your parser can't deal with any other kind. So find the person who produced that file and explain politely that it's no good. (Hitting them with a big stick would be optional.)
    You could write a non-XML program that reads it in and creates a new version, wrapped in a single root element, if your supplier can't fix their problem.

  • How to handle blank root element in xml source file

    Hi There,
    I have a dataflow which using xml source file. The job keep failing and I guess it might be caused by one of the root element which is blank. Can anyone advise me how to handle it?
    The xml file look like this:
    -<orderinfo>
    --<orderdetail>
    ---<orderid>1</orderid>
    ---<orderdate>20110101</orderdate>
    --</orderdetail>
    --<abc />
    -</orderinfo>
    element <abc> is blank
    Thanks and Regards,
    BL

    Hi Suneer,
    The issue is DS cannot validate the source file at all. It returns error message when I try to preview the source file in the dataflow. Is there any work around I can implement other than request the source team to change the file layout?
    Thanks,
    BL

  • Why does loadXML over-write attributes in data DOM even if 'ignore root element' argument is true?

    I'm running Acrobat 9.4 if that makes any difference.  This question was spurred by another discussion on inserting an item into a list.  Basically loadXML is erasing the attributes on the reference node.  For example, if domNode is a node in the data DOM and newXML is a replica of domNode's XML with some child elements changed and newXML_str is the string representation of newXML, then the statement domNode.loadXML(newXML_str,true,true) eliminates the attributes in domNode.  A commenter in the above link states that it happens because the attribute is not stored in the data DOM as an attribute but rather as a child node with prefix '@' but if that were the case it would seem that saveXML should show it as a child element and not as an attribute.  However, saveXML (as shown below) correctly shows the attribute as an attribute.
    What I would like to happen is to have the child attribute node(s) preserved and the child element nodes replaced.  It seems to me that if the second argument is true (ignore root element in xmlArg) then the root element in the data DOM (including attributes) should be unchanged but that is not what happens.  
    Here is some sample XML:
    <docroot>
        <contact uid="29033737">
            <firstName>George</firstName>
            <lastName>Sinkenschneider</lastName>
        </contact>
    </docroot>
    Here's some JavaScript:
    var domNode = xfa.resolveNode("xfa.data.docroot.contact.(uid.value=='29033737')");
    var domNodeXML_str = domNode.saveXML();
    console.println("  contact data node saveXML (domNode) = ".concat(domNodeXML_str));
    console.println("  domNode.uid.value=".concat(domNode.uid.value));
    var newXML_str = domNodeXML_str.replace("George", "Johnny");
    console.println("  newXML_str = ".concat(newXML_str));
    domNode.loadXML(newXML_str, true, true);
    console.println("  DOM node after executing loadXML(newXML_str, true, true) = ".concat(domNode.saveXML()));
    xfa.form.remerge();
    Here's the console output from the script (including all the ugly line-feeds):
      contact data node saveXML (domNode) = <?xml version="1.0" encoding="UTF-8"?>
    <contact uid="29033737"
    ><firstName
    >George</firstName
    ><lastName
    >Sinkenschneider</lastName
    ></contact
    >
      domNode.uid.value=29033737
      newXML_str = <?xml version="1.0" encoding="UTF-8"?>
    <contact uid="29033737"
    ><firstName
    >Johnny</firstName
    ><lastName
    >Sinkenschneider</lastName
    ></contact
    >
      DOM node after executing loadXML(newXML_str, true, true) = <?xml version="1.0" encoding="UTF-8"?>
    <contact
    ><firstName
    >Johnny</firstName
    ><lastName
    >Sinkenschneider</lastName
    ></contact
    >
    Note that the uid attribute is missing from the final DOM node.

    Looks like you may have found a bug .....If I append the new xml I see that the uid attribute is maintained (oit is not touching the root attribute). If I replace it then it seems that the attribute is ignored when the node is re-written. We will need to open a bug with support ...do you want to do that?
    Paul

Maybe you are looking for