DOM dropping needed namespace attribute

So I have the XML document:
<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns="urn:hl7-org:v3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
classCode="DOCCLIN" moodCode="EVN" />I pass it to the following:
private void xmlTweak(String location) {
    try {               
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = factory.newDocumentBuilder();
        org.w3c.dom.Document doc = db.parse(new File(location));
        TransformerFactory tFactory = TransformerFactory.newInstance();
        Transformer transformer = tFactory.newTransformer();
        DOMSource source = new DOMSource(doc);
        FileOutputStream fos = new FileOutputStream(location);
        transformer.transform(source, new StreamResult(fos));
    catch(Exception e) {
        e.printStackTrace();
}All that the above code should be doing is reading it in and outputting the same thing, but it gives me:
<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
classCode="DOCCLIN" moodCode="EVN"/>Notice that the xmlns namespace attribute is missing; I need that attribute in order to get it to pass a schema. After I read the XML file in, if I try doc.getDocumentElement().getAttribute("xmlns"), it confirms that xmlns="urn:hl7-org:v3". I suppose the problem occurs when outputting it back to a file, but what could that problem be?

I found the problem. In case anyone is interested, the problem was with the TransformerFactory. I was using a saxon 8 TransformerFactory, which unexpectedly removed the attribute. Using com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl instead works, so I've switched to it.

Similar Messages

  • Appending namespaces attributes

    Hi there,
    We have a proxy service (pswsdl) and business service (bswsdl)
    I am currently working on transforming xml payload from proxy service (pswsdl) to the xml as compliant with business service (bswsdl).
    I grab the payload from the proxy service via Xquery using $body/subject/person and store it in a variable.
    I need to pass Person object to the business service (bswsdl) which points to a live web service deployed.
    The Person object is the input to Bswsdl web service.
    Now Person element contains a deep level of child nodes. Here is how the fetched object looks like
    <Person xsi:type="imy:com_sample_app_model_PersonInput" xmlns:imy="http://com.sample.app.facade/IMyWebService1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Details>
    <name>Tom</name>
    <age>29</age>
    <address> 11 Park St</address>
    <Details>
    </Person>
    Now when I run the composite I run into an error No Deserializer found to deserialize using encoding style 'null'. [java.lang.IllegalArgumentException] for the Details object. As in the sample payload above the namespace attribute info for the Details object is missing.
    Is there a way in OSB11g Xquery functions to provide an instruction to set the namespace to xml elements automatically. Like in the above case the Person object automatically gets the namespace attributes without any configuration from my side. How can I set this for all the containing xml elements
    Let me know your thoughts.
    Thanks,

    THe xsd for Person does have the type defined for Details object. Since we have developed the web services using the bottom-up approach.
    I tried manually adding the type in the xml elements like this (Details xsi:type="imy:com_sample_app_model_DetailsInput") but still the same error.
    Here is what I tried to do. I have a business service(testBS) based out of live webservice (wsdl). I have a proxy service(testPS) defined using the same wsdl but in the body of the proxy service we delegate the call to testBS. This scenario works perfectly fine.
    Now I have combined two wsdl's (one of them being the same as used for TestBS) and created a proxy service based out of this comined wsdl.
    In the body of the proxy service we make a call to the testBS passing it the only the xml node expected by its operation but this fails though the xml node contains the right xsd type. The top root element gets passed correctly as mentioned in my initial post (the Person node) but its the inner node that fails.
    <con:fault xmlns:con="http://www.bea.com/wli/sb/context">
    <con:errorCode>BEA-382500</con:errorCode>
    <con:reason>
    OSB Service Callout action received SOAP Fault response
    </con:reason>
    <con:details>
    <con1:ReceivedFaultDetail xmlns:con1="http://www.bea.com/wli/sb/stages/transform/config">
    <con1:faultcode>soapenv:Client</con1:faultcode>
    <con1:faultstring>
    No Deserializer found to deserialize a ':Details' using encoding style 'null'. [java.lang.IllegalArgumentException]
    </con1:faultstring>
    <con1:http-response-code>500</con1:http-response-code>
    </con1:ReceivedFaultDetail>
    </con:details>
    Let me know your thoughts.
    Thanks,

  • DOM parser and namespaces

    Hello -
    I have an interesting situation...
    I have a webservice and I want my client to be able to send a org.w3c.dom.Document object as the body of the SOAP request.
    This is easily done w/ the SAAJ API for web services.
    I also want to validate the Document before I send it over the wire.
    Code:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);
    factory.setValidating(true);
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(xmlFileToUpload);
    I have verified that WebLogic 8.1 is using the Apache Xerces parser.
    The XML file that the client will be uploading looks something like this:
    <uploadJobData xmlns="http://server.jobupload.services.mics.apps.mis.jlab.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file://C:\ComputingJobsUpload.xsd">
         <computingJobs>
              <job> .... </job>
    </computingJobs>
    </uploadJobData>
    My schema looks like this:
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
         <xs:element name="uploadJobData">
              <xs:complexType>
                   <xs:all>
                        <xs:element name="computingJobs" type="ArrayOfComputingJobs"/>
    <xs:element name="name" type="xs:string"/>
                   </xs:all>
              </xs:complexType>
         </xs:element>
         <xs:complexType name="ArrayOfComputingJobs">
              <xs:sequence>
                   <xs:element name="job" type="ComputingJob" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
    <xs:complexType name="ComputingJob">
              <xs:all>
                   <xs:element name="queuedTime" type="xs:dateTime"/>
                   <xs:element name="beginTime" type="xs:dateTime"/>
                   <xs:element name="endTime" type="xs:dateTime"/>
                   <xs:element name="numCpusUsed" type="xs:short"/>
                   <xs:element name="numNodesUsed" type="xs:short"/>
                   <xs:element name="chargeFactor" type="xs:decimal"/>
              </xs:all>
         </xs:complexType>
    </xs:schema>
    The problem is, when the code turns on validation, I get an error that states:
    org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'uploadJobData'.
    Why is this?
    Also - and an even bigger issue -
    When I turn off validation, everything works fine. I can handle this, except that the newly added Document in my SOAPBody now has an XML namespace attribute (xmlns) for every element! My namespace is fairly large, so its making the content length of my SOAP request almost twice as big!
    After parsing the XML file in the DocumentBuilder, the XML looks something like this:
    <ns1:uploadJobData xmlns="http://server.jobupload.services.mics.apps.mis.jlab.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file://C:\ComputingJobsUpload.xsd" xmlns:ns1="http://server.jobupload.services.mics.apps.mis.jlab.org">     
    <computingJobs xmlns="http://server.jobupload.services.mics.apps.mis.jlab.org">
    <job xmlns="http://server.jobupload.services.mics.apps.mis.jlab.org">...</job>
    </computingJobs>
    <name xmlns="http://server.jobupload.services.mics.apps.mis.jlab.org">JLab</name>
    </ns1:uploadJobData>
    As you can see, the parser places the namespace attribute for every element.
    Is there any way to turn this off?
    Thanx in advance.
    --Bobby                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Next release is planed to be out next week. We will annouced here when they are ready for download.

  • DBMS_XMLDOM - add namespaces attributes and prefix

    Hi,
    try to add a prefix and a namespace to the root node of an XML structure. Have tried the following code but i failed to add both.
    XML-structure before:
    <PERSON>
    <NAME>something</NAME>
    </PERSON>
    XML-structure desired:
    <pk:PERSON xmlns:pk="http://www.test.com">
    <NAME>something</NAME>
    </pk:PERSON>
    Any help is greatly appreciated.
    THX
    --------------- BEGIN ---------------------------
    declare
    var XMLType;
    buf clob;
    l_xmldoc dbms_xmldom.DOMDocument;
    l_docelem dbms_xmldom.DOMElement;
    l_root dbms_xmldom.DOMNode;
    l_attr dbms_xmldom.DOMAttr;
    begin
    var := xmltype('<PERSON> <NAME>something</NAME> </PERSON>');
    -- Create DOMDocument handle:
    l_xmldoc := dbms_xmldom.newDOMDocument(var);
    l_docelem := DBMS_XMLDOM.getDocumentElement(l_xmldoc);
    -- set prefix
    l_root := dbms_xmldom.makenode(l_docelem);
    DBMS_XMLDOM.setPrefix(l_root, 'pk');
    l_docelem := DBMS_XMLDOM.makeElement(l_root);
    dbms_output.put_line('Prefix: '||dbms_xmldom.getPrefix(l_root));
    dbms_output.put_line('l_root: '||dbms_xmldom.getNodeName(l_root));
    dbms_output.put_line('-----');
    -- add namespace attribute
    l_attr := DBMS_XMLDOM.createAttribute(l_xmldoc, 'xmlns:pk');
    DBMS_XMLDOM.setValue(l_attr, 'http://www.test.com');
    l_attr := DBMS_XMLDOM.setAttributeNode(l_docelem, l_attr);
    -- after
    dbms_xmldom.writetobuffer(l_xmldoc, buf);
    dbms_output.put_line('OUT:');
    dbms_output.put_line(buf);
    end;
    --- OUTPUT ----- OUTPUT ----- OUTPUT --
    Prefix: pk
    l_root: pk:PERSON
    OUT:
    <PERSON xmlns:pk="http://www.test.com">
    <NAME>something</NAME>
    </PERSON>
    ------------------- END -----------------------

    Seems to me you're hitting bug 2904964. I have the same problem using these functions.

  • D namespace attributes questions

    Not sure these are actually Catalyst questions, but they are part of the workflow through Catalyst, so:
    1) Are the "d" namespace attributes (such as "userLabel") compiled into the SWF when compiling in Builder?
    For instance:
    <s:TextInput skinClass="components.UserTextField" text="Username" d:userLabel="UserTextField" x="43" y="82"/>
    1a) If so, how can I access them in AS3?
    1b) If not, what's the use? I know -- they carry over some useful data, but is there something we can do with them in Builder other than search and replace?
    Thanks,
    Kirk

    Hi Kirk,
    Any attribute that has a prefix (d:, th:, ai:, etc) is completely ignored by the compiler and is not accessible at runtime. They are called "private attributes".
    They are not directly useful in Builder. Feel free to strip them out.
    -Adam

  • How do I Ftp a XML file with out namespace attribute

    Hi All,
    How do I FTP an xml file that is validated against a schema on the ftp adapter with out the namespace attribute being added to the first and second element of the XML file.
    For example the xml looks like this when I transfer the file.
    <XML_Event xmlns="http://xmlns.oracle.com/PlannedEventSTORMRequestProcess/STORM">
    <Event_Begin xmlns="">
    <XML_File_Header>
    <Originating_System>xxx</Originating_System>
    <ID>387</ID>
    </XML_File_Header>
    </Event_Begin>
    </XML_Event>
    However I want it to be….
    <XML_Event>
    <Event_Begin>
    <XML_File_Header>
    <Originating_System>xxx</Originating_System>
    <ID>387</ID>
    </XML_File_Header>
    </Event_Begin>
    </XML_Event>
    How do i achieve this using the ftp adapter.
    Cheers

    Here is an example that will try to reach the given size in steps of 4 in quality.
    var saveFile = File(Folder.desktop + "/test");
    var fileSize = 70;
    try{
    tmpFile = File(saveFile+".jpg");
    for(var z =100;z>5;z -=4){
    SaveForWeb(tmpFile,z);
    var chkFile = File(saveFile+".jpg");
    //$.writeln(tmpFile + " qual = " + z + " Size = " +(chkFile.length/1024).toFixed(2) + "k" );
    if((chkFile.length/1024).toFixed(2) < (fileSize +1)) break;
    tmpFile.remove();
    if(!tmpFile.exists)  SaveForWeb(tmpFile,5);
    }catch(e){$.writeln(e + " - " + e.line);}
    function SaveForWeb(saveFile,jpegQuality) {
    var sfwOptions = new ExportOptionsSaveForWeb();
       sfwOptions.format = SaveDocumentType.JPEG;
       sfwOptions.includeProfile = false;
       sfwOptions.interlaced = 0;
       sfwOptions.optimized = true;
       sfwOptions.quality = Number(jpegQuality);
    activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);

  • Need Seeburger Attribute Mapper module details

    Hi Experts,
                       We need to post a file(XML) on Receiver AS2 adapter with dynamic filename. We have followed the link :
    Re: Dynamic Receiver file name in AS2 adapter to create the UDF in GUI mapping and have selected the fileName property under Dynamic Attributes in the Receiver AS2 adapter. However, even though in the message monitor, the filename property is shown to be corrrectly populated, the file is posted in receiver with a different name.
    The above link mentions using an Attribute Mapper module for dynamic filename. Can anyone please provide the details of this module, the module name, parameter names etc. that need to be populated in the receiver adapter.
    The same is not available on the net and we don't have the seeburger documents with us.
    Regards
    Shiladitya

    The module parameter will have
    Source - @Namespace/PropertyName
    Target - Namespace/PropertyName
    This way you may copy source FileName to target FileName.
    Regards,
    Prateek

  • XMLType extract method does not work if namespace attribute values are included

    In the example below, only the second row returns an ID from the extract function. The presence of an xmlns attribute appears to be the cause.
    SQL> drop table configs;
    Table dropped.
    Elapsed: 00:00:03.06
    SQL>
    SQL> create table configs (xml_data sys.xmltype);
    Table created.
    Elapsed: 00:00:00.02
    SQL>
    SQL> create index configs on configs (xml_data) indextype is ctxsys.context;
    Index created.
    Elapsed: 00:00:02.01
    SQL>
    SQL> insert into configs values(sys.xmltype.createxml('<config
    2 xmlns="http://www.ourcompanykscl.com/configuration">
    3 <dataformat
    4 name="F1" description="format spec" id="14082" version="2"
    5      status="started" deployed="true" lastModifiedBy="bloggsj" lastModifiedDate="2002-05-10T09:44:45">
    6 <F11Format>
    7 <SpecificationFilename>c:/formats/F1.txt</SpecificationFilename>
    8 </F11Format>
    9 </dataformat></config>'
    10 ))
    11 /
    1 row created.
    Elapsed: 00:00:01.02
    SQL>
    SQL> insert into configs values(sys.xmltype.createxml('<config>
    2 <dataformat
    3 name="F1" description="format spec" id="14082" version="2"
    4      status="started" deployed="true" lastModifiedBy="bloggsj" lastModifiedDate="2002-05-10T09:44:45">
    5 <F11Format>
    6 <SpecificationFilename>c:/formats/F1.txt</SpecificationFilename>
    7 </F11Format>
    8 </dataformat>
    9 </config>'
    10 ))
    11 /
    1 row created.
    Elapsed: 00:00:00.00
    SQL>
    SQL> BEGIN
    2 ctx_ddl.sync_index('configs');
    3 END;
    4 /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.02
    SQL>
    SQL> SELECT c.xml_data.extract('//dataformat/@id').getstringval(), c.xml_data.getstringval()
    2 FROM configs c
    3 WHERE CONTAINS(c.xml_data, '14082 INPATH (//dataformat/@id)') > 0
    4 /
    C.XML_DATA.EXTRACT('//DATAFORMAT/@ID').GETSTRINGVAL()
    C.XML_DATA.GETSTRINGVAL()
    <config
    xmlns="http://www.ourcompanykscl.com/configuration">
    <dataformat
    name="F1" description="format spec" id="14082" version="2"
    status="started" deployed="true" lastModifiedBy="bloggsj" lastModifiedDa
    te="2002-05-10T09:44:45">
    <F11Format>
    <SpecificationFilename>c:/formats/F1.txt</SpecificationFilename>
    </F11Format>
    </dataformat></config>
    14082
    <config>
    <dataformat
    name="F1" description="format spec" id="14082" version="2"
    status="started" deployed="true" lastModifiedBy="bloggsj" lastModifiedDa
    te="2002-05-10T09:44:45">
    <F11Format>
    <SpecificationFilename>c:/formats/F1.txt</SpecificationFilename>
    </F11Format>
    </dataformat>
    </config>
    Elapsed: 00:00:00.03

    Hi Amarnath,
    Thanks for looking into my issue.
    When I started writing the dynamic custom approver group, I did not use FND_NUMBER and it didnt work. After that I checked it in the AME Implementation Guide which says
    "Queries for number and currency attributes must select the number or currency
    amount converted to a varchar2 by:
    fnd_number.number_to_canonical"
    So that should not be a problem.
    Please correct me if I am wrong but Now I see two different possibilities :
    1. The seeded variable :transactionId which is being passed to the query is not able to get the value. In other words, the transactionId is not being passed.
    2. I am using wrong Attributes to identify the transaction which is being used in the Condition and that condition is used in a Rule. In this case, I am trying to identify that the Basic Person details are changed and I am using seeded attribute HR_IS_PERSON_BASIC_DETAILS_CHANGE_SS in condition.
    Any feedback?
    Appreciate all replies.
    Thanks,
    CAH

  • Need Dynamic attributes for XI adapter to use in Dynamic Configuration ..!!

    Hi Friends,
    We are planning send message to different receivers through XI adapter by using Dynamic Configuration.
    Can anyone please tell me what are the dynamic attributes used for XI adapter.
    In my scenario, I want to pass the Service Number and Path prefix of XI adpater dynamically by using sender ID from Idoc payload.
    I know how to use the dynamic configuration UDF in message mapping. But I don't know the dynamic attributes which we can pass to Service Number and Path prefix of XI adpater.
    Kindly suggest ..
    Thanks
    Deepthi.

    Hi Sourabh,
    >> You need to set these attributes explicitly in the adapter configuration..
    Can you please elaborate on this like how to implement this? Do we need to use any module configuration in the adapter?
    We will use XI adapter only while sending the data directly from IE without using any feautures of AE (like adapters, modules etc). It is like directly sending data from ABAP stack without using J2EE stack. That is the reason we can't use any Modules in XI adpater and it is in disabled by default.
    When I checked in SXMB_MONI.. as you said details are found in
    - <SAP:Attribute>
      <SAP:Name>host</SAP:Name>
      <SAP:Value>10.190.25.16</SAP:Value>
      </SAP:Attribute>
    - <SAP:Attribute>
      <SAP:Name>httpDestination</SAP:Name>
      <SAP:Value />
      </SAP:Attribute>
    - <SAP:Attribute>
      <SAP:Name>path</SAP:Name>
      <SAP:Value>/rcvA/receiver</SAP:Value>
      </SAP:Attribute>
    - <SAP:Attribute>
      <SAP:Name>port</SAP:Name>
      <SAP:Value>8210</SAP:Value>
      </SAP:Attribute>
    XI adapter uses mainly three parameters Host, Port and Path.
    I want to pass any two of these values dynamically to achieve my solution. Can you please suggest your solution how we can implement it.
    -Deepthi.

  • Help Needed: XML Attributes based style mapping!

    Hello all, I am new in this Group. I've reviewed the contents which posted earlier. It is pretty good.
    I need a help from this script forum regarding on mapping the attribute based style mapping.
    like: <emphasis style="italic">Text</emphasis> to be mapped as Italic character style
          <emphasis style="bold">Text</emphasis> to be mapped as Bold character style
    Any one example of VBS / JS is enough, Your highly response / help will be appreciated.
    Thanks
    Guna

    Hi gunasekarant
    here I am giving you the sample XML and XSLT files this works fine
    XSLT
    <xsl:transform
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/">
    <xsl:template match="root">
    <xsl:apply-templates/>
    </root>
    </xsl:template>
    <xsl:template
    <xsl:template match="emphasis[@style='bold']">
      <b><xsl:apply-templates/></b>
    </xsl:template>
    <xsl:template match="emphasis[@style='italic']">
      <i><xsl:apply-templates/></i>
    </xsl:template>
    </xsl:transform>
    XML
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <root>
    <emphasis style="italic">Text</emphasis>
          <emphasis style="bold">Text</emphasis>
    </root>
    I have no idea about XSLT for Docbook for downloading you can develop

  • XSLT help needed namespaces

    Hello all
    I am trying to get rid of namespaces in the XML document. The document XI is producing looks liek this
    <com:ID xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/" schemeID="N/A">0018000562</com:ID>                                                                               
    <com:IssueDate xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">2008-10-02</com:IssueDate>                                                                               
    <com:TypeCode xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">PIE</com:TypeCode>                                                                               
    <main:InvoiceCurrencyCode xmlns:main="http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/">USD</main:InvoiceCurrencyCode>                                                                
    <com:BuyersReferenceID xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/" schemeID="EAN">5790001330217</com:BuyersReferenceID>                                               <com:ReferencedOrder xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">                                                                               
    <com:BuyerParty xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">                                                                               
    <com:DestinationParty xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">                                                                               
    <com:SellerParty xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">                                                                               
    <com:TaxTotal xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">                                                                               
    <com:LegalTotals xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">                                                                               
    <com:InvoiceLine xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">
    And I would like the document to look like this
    <com:ID schemeID="N/A">0018000562</com:ID>
    <com:IssueDate>2008-10-02</com:IssueDate>
    <com:TypeCode>PIE</com:TypeCode>
    <main:InvoiceCurrencyCode>USD</main:InvoiceCurrencyCode>
    <com:BuyersReferenceID schemeID="EAN">5790001330217</com:BuyersReferenceID>
    <com:ReferencedOrder>
    <com:BuyerParty>
    <com:DestinationParty>
    <com:SellerParty>
    <com:TaxTotal>
    <com:LegalTotals>
    <com:InvoiceLine>
    Simply put , XI is including a namespcae for every node  <com:ID xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/" schemeID="N/A">0018000562</com:ID>
    But i would liek just the node  <com:ID schemeID="N/A">0018000562</com:ID>  
    How can we achieve this , XSLT code plz , or could we do this with mapping , adaopter modules etc ..
    Thanks a lot
    Sudheer

    HI Igor
    Looks liek this could be an answer for my problem , I am doing all this to get rid of ns0: prefix which XI adds to its messages . I need to replace this 'ns0' with 'com'
    My message after mapping is
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Invoice xmlns:main="http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/" xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/" xmlns:ns0="http://rep.oio.dk/ubl/xml/schemas/0p71/pie/" xmlns:ns1="http://www.w3.org/2001/XMLSchema-instance">
    +     <ns0:ID schemeID="N/A">0018000562</ns0:ID>+
    +     <ns0:IssueDate>2008-10-02</ns0:IssueDate>+
    +     <ns0:TypeCode>PIE</ns0:TypeCode>+
    +     <ns0:InvoiceCurrencyCode>USD</ns0:InvoiceCurrencyCode>+
    +     <ns0:BuyersReferenceID schemeID="EAN">5790001330217</ns0:BuyersReferenceID>+
    +     <ns0:ReferencedOrder>+
    +          <ns0:BuyersOrderID>sdfsdfsd</ns0:BuyersOrderID>+
    +          <ns0:IssueDate>2008-09-30</ns0:IssueDate>+
    +     </ns0:ReferencedOrder>+
    +     <ns0:BuyerParty>+
    +          <ns0:ID schemeID="EAN">5790001330217</ns0:ID>+
    +          <ns0:PartyName>+
    +               <ns0:Name>Fred the sold to party</ns0:Name>+
    +          </ns0:PartyName>+
    +          <ns0:BuyerContact>+
    +               <ns0:ID>contact person from ARLA</ns0:ID>+
    +               <ns0:Name>contact person from ARLA</ns0:Name>+
    +          </ns0:BuyerContact>+
    +     </ns0:BuyerParty>+
    +     <ns0:DestinationParty>+
    +          <ns0:ID schemeID="EAN">5790001330217</ns0:ID>+
    +          <ns0:PartyName>+
    +               <ns0:Name>Fred the sold to party</ns0:Name>+
    +          </ns0:PartyName>+
    +          <ns0:Contact>+
    +               <ns0:ID>ARLA contact person</ns0:ID>+
    +               <ns0:Name>ARLA contact person</ns0:Name>+
    +          </ns0:Contact>+
    +          <ns0:Address>+
    +               <ns0:ID>Levering</ns0:ID>+
    +               <ns0:Street>14 Easy street</ns0:Street>+
    +               <ns0:CityName>north Andover</ns0:CityName>+
    +               <ns0:PostalZone>0184500</ns0:PostalZone>+
    +               <ns0:Country>+
    +                    <ns0:Code>NL</ns0:Code>+
    +               </ns0:Country>+
    +          </ns0:Address>+
    +     </ns0:DestinationParty>+
    +     <ns0:SellerParty>+
    +          <ns0:ID schemeID="EAN">Vendor&apos;s EAN number not implemented</ns0:ID>+
    +          <ns0:PartyName>+
    +               <ns0:Name>APV SYSTEMS US COMMERCIAL</ns0:Name>+
    +          </ns0:PartyName>+
    +          <ns0:PartyTaxScheme>+
    +               <ns0:CompanyTaxID schemeID="CVR">24730018</ns0:CompanyTaxID>+
    +          </ns0:PartyTaxScheme>+
    +     </ns0:SellerParty>+
    +     <ns0:TaxTotal>+
    +          <ns0:TaxTypeCode>VAT</ns0:TaxTypeCode>+
    +          <ns0:TaxAmounts>+
    +               <ns0:TaxableAmount currencyID="USD">101.53</ns0:TaxableAmount>+
    +               <ns0:TaxAmount currencyID="DKK">60.00</ns0:TaxAmount>+
    +          </ns0:TaxAmounts>+
    +          <ns0:CategoryTotal>+
    +               <ns0:RateCategoryCodeID>VAT</ns0:RateCategoryCodeID>+
    +               <ns0:RatePercentNumeric>25</ns0:RatePercentNumeric>+
    +               <ns0:TaxAmounts>+
    +                    <ns0:TaxableAmount currencyID="USD">101.53</ns0:TaxableAmount>+
    +                    <ns0:TaxAmount currencyID="DKK">60.00</ns0:TaxAmount>+
    +               </ns0:TaxAmounts>+
    +          </ns0:CategoryTotal>+
    +     </ns0:TaxTotal>+
    +     <ns0:LegalTotals>+
    +          <ns0:LineExtensionTotalAmount currencyID="USD">101.53</ns0:LineExtensionTotalAmount>+
    +          <ns0:ToBePaidTotalAmount currencyID="USD">101.53</ns0:ToBePaidTotalAmount>+
    +     </ns0:LegalTotals>+
    +     <ns0:InvoiceLine>+
    +          <ns0:ID>000010</ns0:ID>+
    +          <ns0:InvoicedQuantity unitCode="ST" unitCodeListAgencyID="n/a">1.000</ns0:InvoicedQuantity>+
    +          <ns0:LineExtensionAmount currencyID="DKK">1000.00</ns0:LineExtensionAmount>+
    +          <ns0:Item>+
    +               <ns0:ID schemeID="n/a">DS1234</ns0:ID>+
    +               <ns0:Description>Test material for STO</ns0:Description>+
    +               <ns0:BasePrice>+
    +                    <ns0:PriceAmount currencyID="DKK">1000.00</ns0:PriceAmount>+
    +               </ns0:BasePrice>+
    +          </ns0:Item>+
    +          <ns0:BasePrice>+
    +               <ns0:PriceAmount currencyID="DKK">1000.00</ns0:PriceAmount>+
    +               <ns0:BaseQuantity unitCode="ST" unitCodeListAgencyID="n/a">1.000</ns0:BaseQuantity>+
    +          </ns0:BasePrice>+
    +     </ns0:InvoiceLine>+
    </ns0:Invoice>
    I want to replace ns0: with com:
    Is there a simpler way to achieve this other than cosntructing the whole file with XSLT .
    Thanks a lot
    Sudheer

  • Help needed with attributes losing their values

    Hi there, I have the following code.
    public void actionPerformed(ActionEvent event)
                      // Check to see if Search button pressed
                      if (event.getSource() == searchButton)
                            // Read the isbn and title text fields
                            String supplier = supplierTxtField.getText();
                            String name = nameTxtField.getText();
                            String type = (String)typeBox.getSelectedItem();
                            System.out.println (supplier+" "+name+" "+type);
                            // Display an error message if there is no data in
                            // isbn and/or title text fields
                            if (type.equals(""))
                                JOptionPane.showMessageDialog(frame, "Please enter a product type");
                            if (supplier.equals("") && name.equals(""))
                                  JOptionPane.showMessageDialog(frame,
                                    "Error - you need to enter a supplier and/or item name and item type");
                            else // OK to carry out search
                                  // Search for book(s) based on either the
                                  // isbn or title entered above
                                  System.out.println(supplier+" "+name+" "+type);
                                  searchForItem();
                       //OTHER IRRELEVANT CODE
                 * Search for books.  We can search for books based
                 * upon an ISBN code or title.
                private void searchForItem()
                        // Call the bookSearch() method in DataBaseHandler Class
                        // This method returns a reference to a ResultSet object.
                        System.out.println (supplier+" "+name+" "+type);
                        rs = BellFiresDataBaseHandler.itemSearch(supplier, name, type);
                        // Clear form
                        clearForm();
                        // Set recordCount to 0
                        stockCount = 0;
                        // Display the book details on the form
                        displayItemDetails();
                 }  // End searchForBooks()At the end of actionPerformed, the attributes print out as they should, in this instance the type is Fireplace, the supplier is ABC and the name is null. However, when the same attributes are printed out in the itemSearch method, the values are all null!!! There is nothing that happens in between the two methods and i am completely baffled as to why it does this. It worked fine before i recently changed the input method of the type to JComboBox instead of text field and i had no problems passing through the values.
    If anyone could help me out with this it would be great!
    Thank you!
    Edited by: Chrift on May 24, 2009 10:01 AM

    Ah thank you, so by having the word String in front of the variable names when declaring them i was overriding them and therefore making them local variables.
    I think this is correct, i havent time to test it at the moment so i will declare this question answered when i do!
    Thank you very much :D

  • Internet Speed sudden drops (need to reboot) - "FBI" name in WIFI names - Allowed?

    Question 1: Why do messages asking for help and complaining about Verizon slow speed do not allow a "REPLY" . Verizon filters them?   I see the messages but thee is no Reply button.
    Question 2: in the last two months my internet speed has been dropping regularly (suddenly, Pings go from 100 msec to 999 msec) and requires a reboot of my Box. This is in the Edison (NJ) area. Anybody else in Edison seeing this?
    Question 3: I didn't notice any new neighbor moving in but in the last few weeks there is a new WIFI that shows-up in my area called "FBI_investig_1".   Anybody knows if people are allowed to use such FBI name for their WIFI, just curious...  Or is this genuine when FBI has a local investigation? (not very undercover...)

    To answer your questions, once the ticket has been referred to a Verizon agent you can't reply to the meassage. As to why your pings times are bad it could be almost anything. You will need a Verizon agent to determine that. Lastly someone just changed their SSID to be a wiseguy. The FBI is not going to tell you that there is an investigation going on in your area.

  • Select namespace attributes from xmlns:

    How do I select this information?
    <data>
      <element xmlns:mynamespace="http://my.namespace.com" >mynamespace:Stuff</element>
      <element xmlns:mynamespace="http://other.namespace.com" >mynamespace:Stuff2</element>
    </data>I want to come up with an xpath (using Jdom) that selects the http://my.namespace.com and http://other.namespace.com
    This is a "local" namespace declaration, which I don't know beforehand, so I can't add the namespace programmatically.
    the xmlns:.. part is almost an attribute, but since it's not a regular attribute, I have no way selecting it.
    Any tips?
    /Tom

    To select a node with a namespace, add a namespace to an XPath:
    org.jdom.Document jdomDocument ;
    XPath xpath =
       XPath.newInstance( "/data/element/xmlns:mynamespace");
      xpath.addNamespace("mynamespace", "http://my.namespace.com");Select a node with a namespace prefix:
    org.jdom.Attribute attr
    = (org.jdom.Attribute)
        xpath.selectSingleNode(jdomDocument);

  • Simple XML DOM Example Needed.

    I need a simple XML DOM Example that reads in the XML and makes objects out of the elements. The tutorial from sun is very sketchy and seems to good far too quickly.
    Thanks,
    Dave.

    You can find some examples:
    http://java.sun.com/xml/jaxp/dist/1.0.1/examples/#building
    http://newinstance.com/writing/javaxml2/javaxml2_examples.html
    http://www.docuverse.com/domsdk/index.html#tutorial
    http://www.devx.com/sourcebank/search.asp

Maybe you are looking for

  • Setting up a mail list

    I want to set up a mailing list for my website but I dont want everyone seeing the list of email addresses. Is there a way I can hide the cc list?

  • Bluetooth mighty mouse laggy

    Is it just me, or are wired mouses more responsive. I've had to stop using my bluetooth mighty mouse because there just seems to be too much of a delay between when I move the mouse and when the pointer moves on the screen. Anyone?

  • Compatible HD Hardware - HELP!

    I've got to purchase a hardware setup that works with Flash Media Encoder 2.5. I've purchased a video capture card (DeckLink) that doesn't seem to work. Can someone out there suggest a capture card and HD camera I could use? Relatively low-budget pre

  • Windows 7 home premium pc keeps powering down after startup.

    Windows 7 home premium pc keeps powering down after startup The only thing I have noticed different is the heat sink fan RPMS rev quicker and seem to stay reved for longer periods. The COMPONENTS ARE DUST FREE. Components do not feel warm to the touc

  • IPhone VS iPod

    Almost two years ago I bought me an iPod Touch to listen to my music.  I only bought a 4GB because I didn't really see myself buying 4GB worth of music.  But throughout its use I started to realize the iPod isn't just a music player; I was able to us