Add Namespace in XPATH - Declaration - [JS]-CS4

Dear All,
Here I have a big doubt regarding for XPATH - Add Namespace in JavaScript.
I have to written in Vb.NET
//---------------- Add Namespace in VB.NET --------------------//
Dim xDom As New XmlDocument
Dim xNs As New XmlNamespaceManager(xDom.NameTable)
xNs.AddNamespace("ce", "http://www.elsevier.com/xml/common/dtd")
xNs.AddNamespace("aid", "http://adobe.com/4.0")
AuthorNds = xDom.SelectNodes("//ce:author", xNs)
//--------End
and using the xNs in anywhere, But I can't declare the namespace in Javascript+XPATH.
this.name = "AddReturns";
//XPath will match on every XML element in the XML structure.
this.xpath = "//ce:author";
// Define the apply function.
this.apply = function(myElement, myRuleProcessor)
Only is there in the XPATHs. So How to use and insert the namespace in the Javascript + XPATH operations.
Please kindly give me a suggestion to declare the XPATH in javascript....
Thanks & Regards
T.R.Harihara SudhaN

Thanks for the reply! However, I need the soap envelope to have some additional namespaces defined as:
original request:
<soapenv:Envelope xmlns:soapenv="...">
need this to go to the business service:
<soapenv:Envelope xmlns:soapenv="..." xmlns:xsi="..." xmlns:xsd="...">
Is there a predefined $variable for the envelope?
thanks!

Similar Messages

  • Add namespace declaration into xml root element

    Hello experts,
    I have the following problem:
    I generate a xml message with the following structure (example):
    How can I realise this requirement?
    Thanks and best regards!
    Christopher Kühn

    Hi Christopher,
    Call the below code as a javamappinf in the operation mapping... So now your operation mapping will have two mappings one to convert source to target XML and second this java mapping which will add namespace to your target xml
    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.Reader;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import  com.sap.aii.mapping.api.DynamicConfiguration;
    import com.sap.aii.mapping.api.DynamicConfigurationKey;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    import com.sap.aii.mapping.api.InputHeader;
    public class JavaMapping extends AbstractTransformation {
         public void transform(TransformationInput arg0, TransformationOutput arg1) throws StreamTransformationException {
         getTrace().addInfo("JAVA Mapping Called");
         //Input payload is obtained by using arg0.getInputPayload().getInputStream()
         String inData = convertStreamToString(arg0.getInputPayload().getInputStream());
         String outData = inData.replaceFirst("<root>", "<root xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespace=\"http://test.de/test.xsd\">");
         try
         //8. The JAVA mapping output payload is returned using the TransformationOutput class
         // arg1.getOutputPayload().getOutputStream()
              arg1.getOutputPayload().getOutputStream().write(outData.getBytes("UTF-8"));
         catch(Exception exception1) { }
         public String convertStreamToString(InputStream in){
         StringBuffer sb = new StringBuffer();
         try
         InputStreamReader isr = new InputStreamReader(in);
         Reader reader =
         new BufferedReader(isr);
         int ch;
         while((ch = in.read()) > -1) {
              sb.append((char)ch);}
              reader.close();
         catch(Exception exception) { }
         return sb.toString();
    check stefans blog on the jar files that you need to make this mapping /people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio
    Regards
    Suraj
    Regards
    Suraj

  • How to add namespace prefixes to XMLType created from Object?

    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    I'm working with SOAP request creation from Schema derived Types.
    Consider the registration of the following annotated schema (I wanted Oracle to create the types for me, but with my own names):
    exec dbms_xmlschema.deleteSchema(schemaURL => 'Parameters4.xsd');
    declare
    v_xsd xmltype := xmltype('<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
               xmlns:oraxdb="http://xmlns.oracle.com/xdb"
               xmlns = "http://www.cognera.com"
               targetNamespace = "http://www.cognera.com">
      <xs:element name="Parameters" oraxdb:SQLName="Parameters" oraxdb:SQLType="Parameters">
        <xs:complexType oraxdb:SQLType="Parameters">
          <xs:sequence>
            <xs:element name="Param1" type="xs:string" oraxdb:SQLName="Param1" oraxdb:SQLType="VARCHAR2" />
            <xs:element name="NestedItems" oraxdb:SQLName="NestedItems" oraxdb:SQLType="NestedItemsType">
              <xs:complexType oraxdb:SQLType="NestedItemsType">
                <xs:sequence>
                  <xs:element name="NestedItem" type="NestedItemType" oraxdb:SQLName="NestedItem" oraxdb:SQLType="NestedItemType"/>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:complexType name="NestedItemType" oraxdb:SQLType="NestedItemType">
        <xs:sequence>
          <xs:element name="nParam1" type="xs:string" oraxdb:SQLName="nParam1" oraxdb:SQLType="VARCHAR2"/>
          <xs:element name="nParam2" type="xs:string" oraxdb:SQLName="nParam2" oraxdb:SQLType="VARCHAR2"/>
          <xs:element name="nParam3" type="xs:string" oraxdb:SQLName="nParam3" oraxdb:SQLType="VARCHAR2"/>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>
    begin
      dbms_xmlschema.registerSchema(schemaURL => 'Parameters4.xsd', --this name is local to each ERS schema.                                
                                          schemaDoc => v_xsd,
                                          local => TRUE,
                                          genTypes => TRUE, --only want the types
                                          genbean => FALSE,
                                          genTables => TRUE, --not sure if I need this
                                          force => TRUE,
                                          owner => user);
    end;
    Types created were:
    CREATE OR REPLACE TYPE "NestedItemType" AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T","nParam1" VARCHAR2(4000 CHAR),"nParam2" VARCHAR2(4000 CHAR),"nParam3" VARCHAR2(4000 CHAR))NOT FINAL INSTANTIABLE
    CREATE OR REPLACE TYPE "NestedItemsType" AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T","NestedItem" "NestedItemType")FINAL INSTANTIABLE
    CREATE OR REPLACE TYPE "Parameters" AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T","Param1" VARCHAR2(4000 CHAR),"NestedItems" "NestedItemsType")FINAL INSTANTIABLE
    I found that in order to build these types using constructors (to avoid PLS-00306: wrong number or types of arguments in call to 'NestedItemType'), that I needed to edit these types (drop the xdb magic):
    CREATE OR REPLACE TYPE "NestedItemType" AS OBJECT ("nParam1" VARCHAR2(4000 CHAR),"nParam2" VARCHAR2(4000 CHAR),"nParam3" VARCHAR2(4000 CHAR))FINAL INSTANTIABLE
    CREATE OR REPLACE TYPE "NestedItemsType" AS OBJECT ("NestedItem" "NestedItemType")FINAL INSTANTIABLE
    CREATE OR REPLACE TYPE "Parameters" AS OBJECT ("Param1" VARCHAR2(4000 CHAR),"NestedItems" "NestedItemsType")FINAL INSTANTIABLE
    I read on the forums of a hack to get a namespace added in the output:
    CREATE OR REPLACE TYPE "Parameters" AS OBJECT ("@xmlns" VARCHAR2(4000), -- namespace attribute HACK
                                                           "Param1" VARCHAR2(4000 CHAR),"NestedItems" "NestedItemsType")FINAL INSTANTIABLE
    Putting it all together, I have:
    DECLARE
      v_Parameters    "Parameters";
      v_xml           xmltype;
      v_print_output  clob;     
    begin
      v_Parameters :=  "Parameters"('www.cognera.com',
                                    'hello',
                                  "NestedItemsType"("NestedItemType"('one',
                                                                 'two',
                                                                 'three'
      v_xml := xmltype(xmlData => v_Parameters);
      select xmlserialize(document
                          xmlquery('declare namespace soap = "http://www.w3.org/2003/05/soap-envelope";                                                             
                                    declare namespace cognera = "http://www.cognera.com";
                                    <soap:Envelope>
                                       <soap:Header/>
                                       <soap:Body>
                                       </soap:Body>
                                     </soap:Envelope>
                                   ' passing v_xml returning content) as clob
                          indent size=2
                         ) into v_print_output from dual;
      dbms_output.put_line(v_print_output);
    end;
    This outputs:
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
      <soap:Header/>
      <soap:Body>
        <Parameters xmlns="www.cognera.com">
          <Param1>hello</Param1>
          <NestedItems>
            <NestedItem>
              <nParam1>one</nParam1>
              <nParam2>two</nParam2>
              <nParam3>three</nParam3>
            </NestedItem>
          </NestedItems>
        </Parameters>
      </soap:Body>
    </soap:Envelope>
    What I really want is:
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:c="www.cognera.com">
      <soap:Header/>
      <soap:Body>
        <c:Parameters>
          <c:Param1>hello</c:Param1>
          <c:NestedItems>
            <c:NestedItem>
              <c:nParam1>one</c:nParam1>
              <c:nParam2>two</c:nParam2>
              <c:nParam3>three</c:nParam3>
            </c:NestedItem>
          </c:NestedItems>
        </c:Parameters>
      </soap:Body>
    </soap:Envelope>
    How do I do this without having to programatically add the namespace using a custom XQuery function?

    See this similar thread, it should give you some better alternatives than the "@xmlns" hack :
    Add Namespaces via XQuery to an XML Instance
    For example :
    SQL> SELECT XMLSerialize(DOCUMENT
      2           XMLTransform(
      3             xmltype(
      4               "Parameters"('hello', "NestedItemsType"("NestedItemType"('one','two','three')))
      5             )
      6           , xmlparse(content
      7  '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      8    <xsl:output encoding="UTF-8" indent="yes" method="xml"/>
      9    <xsl:param name="ns"/>
    10    <xsl:template match="/">
    11      <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    12        <soap:Header/>
    13          <soap:Body>
    14               <xsl:apply-templates select="*"/>
    15             </soap:Body>
    16         </soap:Envelope>
    17    </xsl:template>
    18    <xsl:template match="*">
    19      <xsl:element name="{local-name()}" namespace="{$ns}">
    20        <xsl:apply-templates select="@*|node()"/>
    21      </xsl:element>
    22    </xsl:template>
    23  </xsl:stylesheet>')
    24           , q'{ns="'www.cognera.com'"}'
    25           )
    26           INDENT
    27         ) AS "XSLT Output"
    28  FROM dual ;
    XSLT Output
    <?xml version="1.0" encoding="UTF-8"?>
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
      <soap:Header/>
      <soap:Body>
        <Parameters xmlns="www.cognera.com">
          <Param1>hello</Param1>
          <NestedItems>
            <NestedItem>
              <nParam1>one</nParam1>
              <nParam2>two</nParam2>
              <nParam3>three</nParam3>
            </NestedItem>
          </NestedItems>
        </Parameters>
      </soap:Body>
    </soap:Envelope>
    You can store the stylesheet in the XDB repository or in a table and access it using a DBUriType.
    It then provides a concise way to both add the namespace and wrap the payload in the envelope.

  • 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.

  • Help with add file name problem with Photoshop CS4

    Frustrating problem: Help with add file name problem with Photoshop CS4. What happens is this. When I am in PS CS4 or CS3 and run the following script it runs fine. When I am in Bridge and go to tools/photoshop/batch and run the same script it runs until it wants interaction with preference.rulerunits. How do I get it to quit doing this so I can run in batch mode? Any help is appreciated. HLower
    Script follows:
    // this script is another variation of the script addTimeStamp.js that is installed with PS7
    //Check if a document is open
    if ( documents.length > 0 )
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.INCHES;
    try
    var docRef = activeDocument;
    // Create a text layer at the front
    var myLayerRef = docRef.artLayers.add();
    myLayerRef.kind = LayerKind.TEXT;
    myLayerRef.name = "Filename";
    var myTextRef = myLayerRef.textItem;
    //Set your parameters below this line
    //If you wish to show the file extension, change the n to y in the line below, if not use n.
    var ShowExtension = "n";
    // Insert any text to appear before the filename, such as your name and copyright info between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextBefore = "Lower© ";
    // Insert any text to appear after the filename between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextAfter = " ";
    // Set font size in Points
    myTextRef.size = 10;
    //Set font - use GetFontName.jsx to get exact name
    myTextRef.font = "Arial";
    //Set text colour in RGB values
    var newColor = new SolidColor();
    newColor.rgb.red = 0;
    newColor.rgb.green = 0;
    newColor.rgb.blue = 0;
    myTextRef.color = newColor;
    // Set the position of the text - percentages from left first, then from top.
    myTextRef.position = new Array( 10, 99);
    // Set the Blend Mode of the Text Layer. The name must be in CAPITALS - ie change NORMAL to DIFFERENCE.
    myLayerRef.blendMode = BlendMode.NORMAL;
    // select opacity in percentage
    myLayerRef.opacity = 100;
    // The following code strips the extension and writes tha text layer. fname = file name only
    di=(docRef.name).indexOf(".");
    fname = (docRef.name).substr(0, di);
    //use extension if set
    if ( ShowExtension == "y" )
    fname = docRef.name
    myTextRef.contents = TextBefore + " " + fname + " " + TextAfter;
    catch( e )
    // An error occurred. Restore ruler units, then propagate the error back
    // to the user
    preferences.rulerUnits = originalRulerUnits;
    throw e;
    // Everything went Ok. Restore ruler units
    preferences.rulerUnits = originalRulerUnits;
    else
    alert( "You must have a document open to add the filename!" );

    you might want to try the scripting forum howard:
    http://www.adobeforums.com/webx?13@@.ef7f2cb

  • How to add namespaces before a tag name in XML??

    Dear friends:
    I have following code, and hope to add namespaces before the tagname such as Company, Location and even any attributes in this xml,
    Can you help throw some lights??
    Thanks in advance.
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Attr;
    import org.w3c.dom.Document;
    import com.sun.org.apache.xml.internal.serialize.OutputFormat;
    import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
    import org.w3c.dom.Element;
    public class DocWriteDOMStart {
        public static void main(String[] av) throws IOException {
            DocWriteDOMStart dw = new DocWriteDOMStart();
            Document doc = dw.makeDoc();
            ((org.apache.crimson.tree.XmlDocument)doc).write(System.out);
        /** Generate the XML document */
        protected Document makeDoc() {
            try {
                DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
                DocumentBuilder parser = fact.newDocumentBuilder();
                Document doc = parser.newDocument();
                Element root = doc.createElement("Company");;
                doc.appendChild(root);
                Element loc = doc.createElement("Location");
                root.appendChild(loc);
                Element emp = doc.createElement("Employee");
                loc.appendChild(emp);
                emp.appendChild(doc.createTextNode("Daniel Bush"));
                Element emp2 = doc.createElement("Employee");
                loc.appendChild(emp2);
                emp2.appendChild(doc.createTextNode("Sandy Moore"));  
                Element dept = doc.createElement("Department");
                Element e = (Element)dept;
                e.setAttribute("Nationality", "USA");
                e.setAttributeNS("www.yahoo.com", "dept", "http://www.google.com");
                //e.setAttributeNodeNS(newAttr);
                loc.appendChild(e);
                e.appendChild(doc.createTextNode("IT Depart"));
                return doc;
            } catch (Exception ex) {
                System.err.println(ex.getClass());
                System.err.println(ex.getMessage());
                return null;
    }and I got
    <?xml version="1.0" encoding="UTF-8"?>
    <Company>
      <Location>
        <Employee>Daniel Bush</Employee>
        <Employee>Sandy Moore</Employee>
        <Department Nationality="USA" dept="http://www.google.com">IT Depart</Department>
      </Location>
    </Company>hope to add namespaces before the tagname such as Company, Location and even any attributes such as dept, nationality etc in this xml,
    I try but fail.

    You would have to write code that does that, then. Right now your code writes that part of your XML as elements that aren't in a namespace. I can tell you know there are different methods to write elements that are in a namespace because you used a different method to try to write an attribute that is in a namespace.

  • How to add a scale marker in PS CS4 standard? how to update PS extended?

    I just installed PS CS4 standard. I found that I needed to have its extended one to add a scale marker in the microscope images.
    Please let me know how to add a scale marker with PS CS4 starndard. Or, please let me know how to upgrade it to PS CS4 Extended.
    Thanks,

    Here's the instructions for Scale markers: Photoshop Help | Measurement (Photoshop Extended)
    Now for the not so good news. You need Photoshop Extended, but the CS4 version is no longer sold.
    You can either purchase CS6 Extended, Creative Suite 6 (which is over two years old and is no longer updated) or have latest Photoshop as part of the Creative Cloud Photography plan | Adobe Creative Cloud. Photoshop will always have the latest upgrades and versions and it is all "extended", no "standard" here. Run it on Mac or PC, and in many interface languages at no extra charge.
    Hope you find something that will work for you.
    Gene

  • Add Namespace in message mapping

    Hi gurus,
    we have following requirement to solve;
    on receiver side we have a segment without namespace. It is possible to add namespace at the graphical mapping?
    <root>
        <id>1111</id>
        <name>max mustermann</name>
        <unit>B1</unit>
    </root>
    expected structure
    <root xmlns="http://www.org/xml/v0300">
        <id>1111</id>
        <name>max mustermann</name>
        <unit>B1</unit>
    </root>
    solution for this problem will be much appreciated,
    Kind Regards
    PM

    Hi Peter,
                    You can use the following java mapping to meet your requirement
    for PI 7.1 and above (if you are working with lower versions please let us know, since java mapping code will be different for lower versions)
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    public class copyNode extends AbstractTransformation {
          * @param args
         public void execute(InputStream in, OutputStream out)
                   throws StreamTransformationException {
              // TODO Auto-generated method stub
              try
                   DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
                   DocumentBuilder builderel=factory.newDocumentBuilder();
                   /*input document in form of XML*/
                   Document docIn=builderel.parse(in);
                   /*document after parsing*/
                   Document docOut=builderel.newDocument();
                   TransformerFactory tf=TransformerFactory.newInstance();
                   Transformer transform=tf.newTransformer();
                   Element rootin;
                   Node rootout;
                   Element r;
                   rootin=docIn.getDocumentElement();
                   rootout=docOut.importNode(rootin, true);
                   docOut.appendChild(rootout);
                   r=(Element)docOut.getElementsByTagName("root").item(0);
                   r.setAttribute("xmlns", "\"http://www.org/xml/v0300\"");
                   transform.transform(new DOMSource(docOut), new StreamResult(out));
              catch(Exception e)
         public void setParameter(Map arg0) {
              // TODO Auto-generated method stub
         public void transform(TransformationInput arg0, TransformationOutput arg1)
         throws StreamTransformationException {
    // TODO Auto-generated method stub
              this.execute(arg0.getInputPayload().getInputStream(), arg1.getOutputPayload().getOutputStream());
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              try{
                   copyNode genFormat=new copyNode();
                   FileInputStream in=new FileInputStream("C:\\Apps\\my folder\\sdn\\namespaceAdd.xml");
                   FileOutputStream out=new FileOutputStream("C:\\Apps\\my folder\\sdn\\namespaceAdd1.xml");
                   genFormat.execute(in,out);
                   catch(Exception e)
                   e.printStackTrace();
    One more thing, you have not mentioned the scenario. If the scenario has a file adapter in sender side, and you are using File content conversion, then please put the namespace value in content conversion parameters -> Document namespace. Then you will receive the namespace value in source message.
    regards
    Anupam

  • How to add namespace prefix to root tag in XSL version 1.1  SOA 11g

    Hi Experts,
       Can any one post solution for adding namespace prefix to root tag using XSL version 1.1 in SOA 11g?
    I have tried the below options and none is working.
    1. Removing prefix add in exclude-prefixes in XSL.But still seeing no prefix for root tag.
    2. Added the <xsl-element>   tag with namespace.But it is not working
    3. Added the below XSL code and it is not working.
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       xmlns:ns0="https://api.ladbrokes.com/v1/sportsbook-couchbase/Temp.xsd">
      <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
      <xsl:template match="@* | node()">
       <xsl:copy>
       <xsl:apply-templates select="@* | node()"/>
       </xsl:copy>
      </xsl:template>
      <xsl:template match="/*">
       <xsl:element name="ns0:{local-name()}">
       <xsl:copy-of select="namespace::*" />
       <xsl:apply-templates select="@* | node()" />
       </xsl:element>
      </xsl:template>
    </xsl:stylesheet>

    Try this:
    <xsl:stylesheet  version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="@*|text()|comment()|processing-instruction()">
            <xsl:copy>
                <xsl:apply-templates select="@*|node()"/>
            </xsl:copy>
        </xsl:template>
        <xsl:template match="/">
            <RootTag xmlns:ns0="https://api.ladbrokes.com/v1/sportsbook-couchbase/Temp.xsd">
                <xsl:apply-templates select="@*|node()"/>          
            </RootTag >
        </xsl:template>
        <xsl:template match="*">
            <xsl:element name="{local-name()}">
                <xsl:apply-templates select="@*|node()"/>
            </xsl:element>
        </xsl:template>
    </xsl:stylesheet>

  • Validating namespace in XPATH

    Hi,
    How do I resolve the namespaces in the XPATH. I'm using Xalan 2.4 package and it's API. I made a simple test program where I pass the Xpath and I get back the node. The problem i'm facing is that if the xml document in question has some namespace declared. In the Xpath expression if I include the name space then it does not return the proper result. Where as when I give the Xpath without the namespace prefix it returns the node. I'm using the evaluate method of the XPathEvaluatorImpl class ( in package org.apache.xpath.domapi). This method takes XPathNSResolver (the namespace resolver) as one of the parameters. I passed that too still the problem persisted. If any one could help me out here it would be great. if you need further details I can post the code.

    To answer my own question..
    The mistake I was commiting was at a very upper level.
    While creating the DOM..the Factory instance I was using was of the type which does not resolve the namespaces properly. That is why even though my XPATH objects had the resolver set properly still I was not able to get to the proper node.
    Sorry If I wasted any one of you's time :)

  • Namespace-aware XPath expressions?

    In xMII 11.5.2 b64, I need to extract a node from a SOAP message:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
       <soapenv:Header/>
       <soapenv:Body>
          <ns0:importRequest xmlns:ns0="http://www.acme.com/1.0/schemas">
            <FOO>
    The following xMII Assign action Link returns me the entire <FOO> nodeset:
    Transaction.SOAPRequest{/soapenv:Envelope/soapenv:Body/ns0:importRequest/*}
    However, I cannot be guaranteed that the namespace prefixes will always be "soapenv" and "ns0".  For example, the following is perfectly valid:
    <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP:Header/>
       <SOAP:Body>
          <ZZZ:importRequest xmlns:ZZZ="http://www.acme.com/1.0/schemas">
            <FOO>
    When they are changed the XPath fails.  I have tried the following:
    Transaction.SOAPRequest{/Envelope/Body/importRequest/*}
    Transaction.SOAPRequest{//importRequest/*}
    but they clearly don't work because the XPath evaluator in xMII is namespace aware (as it should be).
    How can I declare namespaces in my XPath expression?  Or are there any other alternate ideas?
    Thanks,
    -tim

    I installed SR3 and re-ran my tests and it still fails.  Here is my XML snippet:
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:sch="http://www.acme.com/4.3/schemas">
       <SOAP:Header/>
       <SOAP:Body>
          <sch:importIDOCRequest>
             <MATMAS03>
    Here's the output from various expressions in the Link editor:
    example 1 - getting the name of the root node:
    "root node name=" & Transaction.SOAPRequest{name(/*)}
    output 1 is predictable:
    [INFO ]: root node name=SOAP:Envelope
    example 2 - using 'senv' instead of 'SOAP' for the soap-envelope namespace prefix:
    "importRequest child node name=" & Transaction.SOAPRequest{name(/senv:Envelope/senv:Body/sch:importIDOCRequest/*)}
    output 2:
    [INFO ]: importRequest child node name=
    example 3 - no namespace prefixes specified:
    "importRequest child node name=" & Transaction.SOAPRequest{name(/Envelope/Body/importIDOCRequest/*)}
    output 3:
    [INFO ]: importRequest child node name=
    example 4 - using the same node namespaces prefixes as the input XML:
    "importRequest child node name=" & Transaction.SOAPRequest{name(/SOAP:Envelope/SOAP:Body/sch:importIDOCRequest/*)}
    output 4:
    [INFO ]: importRequest child node name=MATMAS03
    Any other ideas?
    -tim

  • Add namespace in soap envelope

    Hi:
    Is there a way to add/change the namespace declaration in the soap envelope using pipeline?
    example:
    incoming request:
    <soapenv:Envelope xmlns:soapenv="...">
    <soapenv:Header>...</soapenv:Header>
    <soapenv:Body>...</soapenv:Body>
    </soapenv:Envelope>
    out to business service:
    <soapenv:Envelope xmlns:soapenv="..." xmlns:xsi="..." xmlns:xsd="...">
    <soapenv:Header>...</soapenv:Header>
    <soapenv:Body>...</soapenv:Body>
    </soapenv:Envelope>
    thanks!!
    nav

    Thanks for the reply! However, I need the soap envelope to have some additional namespaces defined as:
    original request:
    <soapenv:Envelope xmlns:soapenv="...">
    need this to go to the business service:
    <soapenv:Envelope xmlns:soapenv="..." xmlns:xsi="..." xmlns:xsd="...">
    Is there a predefined $variable for the envelope?
    thanks!

  • How to Add namespace to all elements in a xml document

    Hi,
    I am trying to read an xml file that does not have any namespace definitions. I have been able to create another schema in which i specify the namespace defination as shown below.
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://TargetNamespace.com/AckPaymentFile_PL" targetNamespace="http://TargetNamespace.com/AckPaymentFile_PL" xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" nxsd:version="DTD" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <include schemaLocation="PM_XML_FILE_ACK_SCHEMA_NO_NAMESPACE.xsd"/>
    </xs:schema>
    Once i do it, i am able to see the namespace has been assigned to the root element. I am looking for a way to assign the namespace and prefix tag to all elements in the xml document. If i don't i am unable to access any part of the xml document, keep getting please verify if xpath is correct.
    Thanks
    Sridhar

    Hello,
    Once you've answered all the above.
    If you can run xpath that supports functions against the xml, the expression:
    count(//phone)Otherwise, without leaving SQL:
    select count(*) from
    xmltable('//phone' passing
      -- Your XML goes here, could be a table column with type XMLTYPE.
      xmltype('<person><phone>123-456-7890</phone><phone>098-765-4321</phone></person>')
      columns phone varchar2(24 char) path '/phone'
    ;

  • VEFU - Manual add entries for INTRASTATE declaration

    Hello
    Is it possible in transaction VEFU, during manual adding new entries:
    1. Add also document number? On system 6.0 I have this field not for edit.
    2. Add returns? I'm adding document category Return or Credit Memo, but those values  are not substracted in intrastate declaration. (even when in VEFU i put negative values.

    Hello Malgorzata Paraficz
    I am not in EU and not an INTRASTAT expert, but thought I could try and help you.
    Answers to your questions:
    1) Yes, you can add Document number. We are on 6.04 and it is editable, ut I guess the version  should not matter. Note 674218 is intended for lower releases, but  from that you can make it out that you can add document number to add an entry.
    2) You need not add returns manually, SPA says 'if a returns credit memo exists in the system, the system automatically takes the customer returns into account during the dispatch selection and stores them on the receipt side in the intrastat worklist table VEIAV".  But you need to ensure config is correct and complete and all the necessary info must exist in the billing document  for it to be selected. See OSS note 883521 below. However as  note 374682 says " if only a returns document exists, you must always make a manual entry (VEFU)." If you need to report returns on both receipt and despatch side, then you need to follow note 1171707 to automatically generate the entries.
    Please go through the following OSS notes:
    883521 - Intrastat for returns, cancallations, credit & debit memos
    374682 - Intrastat for returns, debit memos, credit memos
    1171707 - Intrastat: Reporting returns as arrival and dispatch
    674218 - INTRASTAT: VEFU - Document number/item not ready for input
    Hope this helps. Let me know.

  • Add and change shortcuts in Bridge CS4 ...

    Hi,
    is there a way to change and to add some shortcuts in Bridge CS4 as I can do it in Photoshop CS4?
    Thanks

    Hi
    I was looking to change the rotation shortcut as well since my Norwegian keyboard on my Macbook Pro does not have the two signs used  [  ].
    I knew there was some shortcut that I could use to rotate right and left, so I tested out the cmd/apple key + fn key + and the key to the right of P (on my Norwegian keyboard that would be å and the key to the right of it is the key for ¨.These worked with rotation.
    What this would be for the PC I do not know.
    It is a start. Try and experiment.
    Paal Joachim
    spirituellfilm.no

Maybe you are looking for

  • Dunning - mail and save pdf

    Hello, we have received the question to mail a dunning and save this pdf on a location. Mailing is not a problem (copied FI_OPT_ARCHIVE_DUNNING_NOTICE to a z-variant and adapt it to our needs-, but I don 't see how I can force the system to create al

  • I need to open a file with an associated programm.

    I need to open a file with an associated programm. I'm looking for two solutions: 1. for Linux/Solaris/Unix/... 2. for Windows 95/98/Nt/2000 For Windows I have done this with command line Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandle

  • Custom component accessing data

    I am trying to build a custom component that utilizes the datagrid. I want to create a class that loads in xome XML and populates the datagrid. The datagrid's ID is not available in the class's load.COMPLETE event handler, so I cannot populate the da

  • Migrating from 2003 domain/forest level to 2008R2 with all DC's at 2008R2 and 2 other Domain External and Forest Trusts

    Is there anything that needs to be done or considered when migrating from 2003 domain/forest level to 2008R2 with all DC's at 2008R2 with 2 other 2003 separate Domain incoming and outgoing Trusts, one Trust that is a Forest Trust and the other is an

  • Lookups in external datasource

    Hello, Is it possible to create lookup field in data object with external data-source?? If not then what is the alternative??