Default namespaces & templates

I have a XML-document with a default namespace. If I do not declare a namespace in the template like described in Re: How use xml with namespaces , I do not get any data in my report.
The only problem I have right now is that I have to add the name I declare to every field.
<?xmlns:my_ns=http://www.oracle.com/myurl?>
<?for-each:my_ns:myElement1?>
<?my_ns:myElement2?>
The XML does not contain this name:
<myElement1><myElement2>my value</myElement2></myElement1>
My questions:
- is there any way to circumvent the need to add my_ns: to all my fields ?
- is there a reason why this works like this ?
Thanks in advance for your reply

Hi there,
Multisim/Ultiboard includes the ability to create user templates, basically a Multisim file (for your schematic) and an Ultiboard file (for the PCB layout). Details can be found at:
Prototype Rapidly with Multisim and Ultiboard User Definable Templates
Hope this helps!
Fernando
Fernando D.
National Instruments

Similar Messages

  • Error on page from BW 3.5's default web template

    Hi Guru's,
    We have a problem in our new BWD BW 3.5 environment where we are getting the "error on page" error from SAP-generated code and we aren’t sure why.
    On our old BWT BW 3.0b platform, we have been using a modified version of the 0query_template called Z_QUERY_TEMPLATE. We did a system copy of BWT to BWD, our new BW 3.5 platform. At that point in time we would see our old BW 3.5 default template for queries that we ran. We wanted to see what the new default web template looked like in BW 3.5. We found where we could remove the Z_QUERY_TEMPLATE from the Web Adhoc Analysis web template setting so we could see the new features of the BW 3.5 default BEx query designer template instead of our old BW 3.0b default template.
    Now when we run a query through the BW 3.5 query designer on BWD, we are using BW3.5’s default template. The prompt web page is fine. No errors on page messages.
    However, the initial presentation of the query results displays okay, but shows "error on page" in the message bar at the bottom of the displayed page. As soon as we do any navigation on those query results that error on page goes away. If we navigate back to the initial presentation, all is still okay. If we use the context menu to go back to start, we again get the error on page.
    This error on page does not happen in BQ2 (our new BW 3.5 QA environment copied from our old BW 3.0b QA environment where we had not yet changed the default BEx Query Designer template to be Z_QUERY_TEMPLATE). We have tried several queries and in each case, we get errors on page in BWD, but not in BQ2. We used ultraedit to compare the view source output from the equivalent web pages from BWD and BQ2 and the only difference is the validity date of the data. There are no other differences in the javascript code generated by BW in the two platforms.
    The statement that Internet Explorer is saying is the problem is the same in each of the cases we have checked and that is:
    SAPBWSetFocus(anchor);
    Error: Object expected
    Code: 0
    It’s in the set_tab() function.
    <script type="text/javascript">
    <!--
    /* Calls the online Documentation via technical QueryName */
    function callquerydoc() {
      var docustart= '/sap/bw/doc/meta/fldmeta/default?tlogo=elem&objnm=' + document.getElementById('querydoc').innerHTML;
      SAPBWOpenWindow(docustart,'Documentation',800,600);
    /* Sets the displayed tab */
    /* Check, which items of the Array check_items  is not hidden.
        Change the style of the HTML tag with id Group+Area/Group+Link */
    function set_tab() {
         if (!(navigator.appVersion.substring(0,1) == '4' && navigator.appName == 'Netscape')) {
           var check_items = new Array('GR1Toolbar','GR2Chart','GR3TECommon','GR4Broadcaster');
        for (i=0;i<check_items.length;i++) {
                        hidden = true;
                       prop = SAPBWGetItemProp(check_items<i>);
                       if (prop != null){
                                           for(j=1;j<prop.length;j++){
                                                      if (prop[j][0] == "HIDDEN")  hidden = (prop[j][1] == "X");
                   anchor_item = document.getElementById(check_items<i>.substring(0,3)+'Area').firstChild;
                    if (hidden) {
                        document.getElementById(check_items<i>.substring(0,3)+'Area').className='SAPBEXTbsTab';
                        anchor_item.title = 'Inactive Tab Page:' + ' ' + anchor_item.title; 
                    else {
                        document.getElementById(check_items<i>.substring(0,3)+'Area').className='SAPBEXTbsTabSel';
                        anchor_item.title = 'Active Tab Page:' +' ' + anchor_item.title; 
              } /* if */
          }   /* for */
        /* Set the BexHeader invisible when running as IView */
            if (SAPBWGetProperty('RUNS_AS_IVIEW')) {
                               document.getElementById('bexheader').style.visibility='hidden';
                               document.getElementById('bexheader').style.display='none';
              anchor = window.location.hash.substring(1,50);
              <b>SAPBWSetFocus(anchor);</b>
      }  /*function */
    -->
    </script>
    Because the error goes away as soon as we navigate I’m thinking some object isn’t being created or initialized, but since the view source code of these pages are identical I’m wondering if there is some code that should be executing before this page that is not happening in BWD for some reason.
    Any help will be much appreciated.
    Thanks,
    Jeri

    Heike,
    Thanks for your help in this. BWD and BQ2 are both on the same SP. SAP_BW release 350 level 10 (SAPKW35010) with BI_CONT at release 352 level 5 (SAPKIBIEP5).
    I invalidated the server cache following your instructions and tried again, but am still having the same problem in BWD. The initial display gets the "Done, but with errors on page" message until any navigation is done.
    I am using IE 6.0.2900.2180.xpsp_sp2_rtm.040803-2158 when I execute queries on both BWD and BQ2.
    Please, do you have any other suggestions?
    Thanks,
    Jeri

  • Access to customizing default: report templates

    I seem to remember far back in the corners of my memory, someone here on the forum mentioning that although we didn't have access at the time (probably back at HTMLDB 2.0) to customize the default report templates, that there were plans to make this an option in a future version of Apex. Does anyone have any idea if this is something that is being planned, or better yet, available today?
    If you're not sure what I'm talking about I'm referring to the field that says 'Report Template' in the 'Layout and Pagination' section of the 'Report Attributes' page in the application builder.
    The problem I'm having is that I'm using the 'default: vertical report, look 2 (show null columns)' report template and I've got some long column headings that I want to include a line break between each word of the heading, so they're stacked vertical instead of wide horizontally. I've add HTML break tags to the headings but they're disappearing when the page is rendered.
    I've made sure to set the 'Strip HTML' setting to 'No', but whether it's set to yes or no doesn't matter, the headings display the same either way.
    BTW, doing the same thing in a template based multi-row report seems to work fine. However, trying to use/apply the 'Value Attribute Pairs' report template yields the same result as the default vertical look template.
    So I have 2 questions:
    1) anyone know how I can make these heading words stack up vertically, one word to a line?
    2) are we going to get access to customize the default report templates?
    Earl

    Hello,
    1) anyone know how I can make these heading wordsstack up vertically, one word to a line?
    Probably the best way to do this is to just hard code
    a &lt;br /&gt; between your words.That's exactly what I'm doing (and what I said in my original post), however those breaks are disappearing during page rendering when I choose the report templates I mentioned.
    I don't understand why this technique works in the multi-row report templates and not in these vertically oriented value/attribute report layouts.
    2) are we going to get access to customize thedefault report templates?
    No, you should just use a regular theme based
    template, the default report templates are there for
    backwards compatibility and well basically for people
    that don't care about the UI. Since your at the point
    it seems you do care about UI the proper thing to do
    is to move to a standard report template that you
    have full control over.Fair enough. I'll look into that, but I think there's still an open question here as to why the HTML breaks aren't being returned in the page markup for these report layouts.
    Regards,
    CarlEarl

  • Fix table header line of Query in default web template WAD 7.0

    Dear all,
    I would appreciate if somebody could help me to set parameters to fix the header line of a Web-Item DataProvider (Query) in the default web template 0ANALYSIS_PATTERN for the BEx Web Analyser. I mean I want to see the header line with the characteristics and key figures description even if I scroll down in the query. 
    My idea was to create a second frame in the template and to fill it with the same DataProvider just with the header of the Query. The problem is that the performance of the query would be badder if we load two Dataprovider/Query instead of one.
    Many thanks in advance for your answer and help!!!
    Best regards
    Abdel

    Hi Dion,
    Thank you very much for your answer! I have tried to find a paramter in the web application designer to do that, but without success. Now I have included a new container with the same Analysis Web Item, but it does not function! May you have a better idea??
    Thank you very much in advance for your help. I'll also post my question in a BI-Forum as you suggested. 
    Best Regards
    Abdel

  • Default namespace & interface in Sender Soap Adapter XI vs. PI 7.1

    In XI there is an option to set the default namespace and interface for sender SOAP adapters. Where or how is this to be handled in PI 7.1

    Hello,
    Where or how is this to be handled in PI 7.1?
    This is handled by your sender agreement whenever you post to the URL http(s)://host:port/XISOAPAdapter/MessageServlet?channel=p:s:c
    Hope this helps,
    Mark

  • Can you validate an XMLElement that uses the default namespace?

    We have a partner that we communicate with via XML over HTTP and the schema that they gave us for their request/response does not specify a namespace. I am able to import the schema and create variables from its elements to send the request and get a response back but when I try to validate the response I am getting an error.
    We are using SOA Suite 11g and the bpelx:validate action to try to validate the variable but it consistently gives back the following error message.
    java.lang.IllegalArgumentException: null schema location for ns=null [Cause=null schema location for ns=null]
    I am pretty sure this is because there is no namespace specified in the response data. Is there anyway that I can validate this XML against the schema without a namespace? This is an existing interface that we are converting so we don't have the flexibility to ask the partner to change their interface. I am able to validate the same XML data in XML Spy against the schema and have been able to recreate this problem with a different small xsd with the default namespace.
    I think I can write a java utility to perform the validation and call it using the embedded java action but I am hoping there is a way to do it within the tool.

    Hi,
    For Crystal Design related queries, close this thread and start the thread in the [SAP Crystal Reports Design forums|http://forums.sdn.sap.com/forum.jspa?forumID=300&start=0]
    - Bhushan

  • Default namespace in the SOAP sender adapter

    Hi All!
    Sorry for the following really easy question but what is the default interface name and default namespace in the SOAP sender Adapater? The name of the interface to where the adapter should forward the received SAOP message?
    it means that for every soap message a new communication channel should be created. Or only one channel is enough?
    And in the receiving case only one is enough or for every web services a new receiving communication channel need to be created?
    Thank you for your answer.

    Hi,
    q) what is the default interface name and default namespace in the SOAP sender Adapater?
    Ans) Soap Sender does not have any default namespace and interface.  That can be set at Sender Agreement. 
    q) The name of the interface to where the adapter should forward the received SAOP message?
    Ans : That message is forwarded to Adapter Engine and then to integration Engine. That takes interface in sender agrement and Namespace.
    it means that for every soap message a new communication channel should be created. Or only one channel is enough?
    Ans:  For sender, 1 communication channel is enough. For Receiver, if you have 10 different systeems, then  you need to create those many receiver communication channels .
    And in the receiving case only one is enough or for every web services a new receiving communication channel need to be created?
    Ans : Same as above
    Note  Soap message is not criteria for creating channels....  Please note that .. soap communication channels creates soap messagae.
    -Subbu

  • Problem with default namespaces

    Hello,
    I'm using version 2.3.10 of Berkeley XML.
    All my XML documents have a default namespace declared in the root element, like this:
    <rootElement xmlns="http://www....something.../something">
    but I get errors when I query the documents - and the only way of avoiding the errors seems to be by manually removing the default namespace attribute.
    I tried setting the XmlQueryContext.setNamespace("", myUri) - but it doesn't work. I saw this mentioned in another post - and you said it was scheduled to work that way in the next release.
    Can you tell me when the next release will be, and what I can do right now to get around this problem. I need to keep the xmlns attribute in the root element since I have other applications which need to access the documents before I put them into the database and they make use of it.
    Kind Regards
    Swami Kevala

    Hi Swami,
    You have two options:
    1) Bind a prefix to your namespace URI, and use that prefix in your queries:
    XmlQueryContext.setNamespace("pre", myUri);
    XmlManager.query("/pre:rootElement", qc);
    2) Bind the default element namespace inside the query:
    XmlManager.query("declare default element namespace \"" + myUri + "\"; /rootElement", qc);
    John

  • How to suppress n0: default Namespace prefix in Transformations

    Hi,
    I use Simple Transformations for serialization of deep structured data.
    In the XML File the whole tree needs to use a special namespace. Therefore i use the attribute xmlns="ABC.de" without a namespace prefix in my root element. During serialization SAP generates a default namespace prefix like 'n0:'.
    Is it possible to suppress the generated namespace prefix?
    Thank you very much for reply
    René
    Edited by: René Libbert on Feb 14, 2012 8:09 AM

    Maybe somebody is interested.
    It seems to be a problem on old 640. On a NW 702 the result is as expected. NW 700 was not tested.
    Workaround for the 640 is to use as result a STRING field not an XSTRING.
    Greetings René

  • How to default the  template based on a responsibility

    Hello All,
    I am working on 12.1.1 and XML Publisher version 10.1.3.2.1
    I have a concurrent program with multiple templates, one each for different language/territory combinations. The layout of each template is different. In the template definition, I have different localized template files for each lang/terr combination
    template_en_GB- UK
    template_en_IE - Ireland
    template_de_DE -Germany
    template_sv_SE -Sweden
    Template_en -Default
    When the user submits the request, for UK, Ireland and Germany it picks the correct template as defined in the territory but for Sweden the template is always defaulted to the default template file in the template definition and the user needs to change it to their desired template each time. How do I default the template based on the language/territory of Sweden combination. It is working fine for all other territories buit not for Sweden. We have not used the add.layout option in any report so I don't want to use that option.
    Is any setup I am missing for Sweden?
    We are having Sweden rollout soon.
    Thanks,
    Joohi
    Edited by: 935051 on 11-Jan-2013 03:09

    if for other template it's work fine
    then IMHO only SR

  • Replacing default namespace in OSB message flow

    I'm in the process of setting up a simple OSB proxy and could use some help figuring out how to change a default namespace in the response from the business service.
    The proxy and business service use different namespaces which we'll call "http://foo.com/namespace/proxy" and "http://foo.com/namespace/business". In my routing request message flow, the contents of $body look like this and I'm able to use a Rename action with XQuery expression "./sof:*" to change "http://foo.com/namespace/proxy" to "http://foo.com/namespace/business":
    <sof:Execute xmlns:sof="http://foo.com/namespace/proxy">
    <sof:adminName>MyAdaptor</sof:adminName>
    <sof:request>
    [escaped payload omitted]
    </sof:request>
    </sof:Execute>
    This works fine, but in the response message flow, I need to revert the namespace and am having difficulty because the response uses a default namespace instead of using a prefix:
    <ExecuteResponse xmlns="http://foo.com/namespace/business">
    <ExecuteResult>
    [escaped payload omitted]
    </ExecuteResult>
    </ExecuteResponse>
    If I define a prefix P2L in the expression editor to correspond to "http://foo.com/namespace/business", I'm able to reference the ExecuteResponse element as "./P2L:ExecuteResponse", but then I get stuck.
    If I try use a Rename action to change the namespace for "./P2L:*", only the ExecuteResponse element is renamed to <sof:ExecutResponse xmlns:sof="http://foo.com/namespace/proxy">. Upstream in the calling application, there's an XML stream reader exception because (I assume) ExecuteResult is not found and parsed.
    I also tried using a Replace action against "./P2L:ExecuteResponse/@xmlns" to replace its contents with "http://foo.com/namespace/proxy". I also tried "./P2L:ExecuteResponse/@P2L:xmlns". Neither worked.
    Can anyone tell me what I'm doing wrong, or suggest a different approach? Assume that changing the calling application or business service is not an option.
    Thanks!

    >
    If I define a prefix P2L in the expression editor to correspond to "http://foo.com/namespace/business", I'm able to reference the ExecuteResponse element as "./P2L:ExecuteResponse", but then I get stuck.
    If I try use a Rename action to change the namespace for "./P2L:*", only the ExecuteResponse element is renamed to <sof:ExecutResponse xmlns:sof="http://foo.com/namespace/proxy">. Upstream in the calling application, there's an XML stream reader exception because (I assume) ExecuteResult is not found and parsed.
    >
    You pattern "./P2L:\*" matches just one element so it's ok that the payload's namespace wasn't touched. If you want to rename namespace for all elements try "//P2L:*". However, I'm not sure whether this is what you want. Try do describe what you do, what you want and what you get instead.
    >
    I also tried using a Replace action against "./P2L:ExecuteResponse/@xmlns" to replace its contents with "http://foo.com/namespace/proxy". I also tried "./P2L:ExecuteResponse/@P2L:xmlns". Neither worked.
    >
    I think it's not a good approach to replace content of xmlns as this attribute is not a common xml attribute.

  • Default Namespace Support

    Hi,
    I am NOT using the XPath helper package. I am using xslprocessor.selectNodes() to get a nodelist.
    My xml document contains a default namespace, and I cannot change it.
    Is there a work around to the fact that default namespaces is not supported? I'm getting "Namespace prefix 'x' is used but not declared" on the following pl/sql line:
    guests := xslprocessor.selectNodes(xmldom.makeNode(xmldoc), '/xml/rs:data/z:row');
    I'm willing to jump through a few hoops, if necessary.
    Thanks for any insight!
    Regina

    Correction. Please use the following test case.
    1. Create an application and a project in JDeveloepr 11g.
    2. Add an XML document. catalog.xml, from the New Gallery.
    What doesn't generate an error.
    3. Copy the following XML documen to catalog.xml.
    <?xml version="1.0" encoding="UTF-8"?>
    <catalog xmlns:journal="http://www.xdk11g.com/xpath">
    <journal:journal journal:date="November-December 2008">
    <journal:article journal:section="ORACLE DEVELOPER">
    <title>Instant ODP.NET Deployment</title>
    <author>Mark A. Williams</author>
    </journal:article>
    </journal:journal>
    <journal date="March-April 2008">
    <article section="TECHNOLOGY">
    <title>Oracle Database 11g Redux</title>
    <author>Tom Kyte</author>
    </article>
    </journal>
    </catalog>
    4. Select Search>XPath Search.
    5. Add a namespace mapping with Add button.
    Prefix: journal
    URI: http://www.xdk11g.com/xpath
    6. Specify an XPath expression in Expression field.
    /catalog/journal:journal
    7. Click on OK. The jounal:journal node gets selected.
    What generates an error (the bug).
    8. Copy the following XML document to catalog.xml.
    <?xml version="1.0" encoding="UTF-8"?>
    <catalog xmlns="http://www.xdk11g.com/xpath/defaultNamespace">
    <journal date="November-December 2008">
    <article section="ORACLE DEVELOPER">
    <title>Instant ODP.NET Deployment</title>
    <author>Mark A. Williams</author>
    </article>
    </journal>
    <journal date="March-April 2008">
    <article section="TECHNOLOGY">
    <title>Oracle Database 11g Redux</title>
    <author>Tom Kyte</author>
    </article>
    </journal>
    </catalog>
    9. Add a namespace mapping with Add button for the default namespace. Specify prefix as empty.
    Prefix:
    URI: http://www.xdk11g.com/xpath/defaultNamespace
    10. Specify an XPath expression in Expression field.
    /catalog/journal
    11. Click on OK. The journal node does not get selected.

  • Output XML with a default namespace using XQuery

    I'm having a problem with namespaces in an XQuery within ALSB.
    We receive XML from a file which doesn't have any namespace and have to transform it into a different structure, giving it a default namespace such as below:
    Input XML
    <inputRoot>
         <inputAccountName>Joe Bloggs</inputAccountName>
         <inputAccountNumber>10938393</inputAccountNumber>
    </inputRoot>
    Desired output XML
    <outputRoot xmlns="http://www.example.org/outputSchema">
         <outputAccounts>
              <outputAccountName>Joe Bloggs</outputAccountName>
              <outputAccountNumber>10938393</outputAccountNumber>
         </outputAccounts>
    </outputRoot>
    When I attempt to do this using XQuery mapper tool, I end up with a namespace prefix on the outputRoot. The XQuery and result follows:
    XQuery
    declare namespace xf = "http://tempuri.org/XQueryProject/scratchTransformations/test/";
    declare namespace ns0 = "http://www.example.org/outputSchema";
    declare function xf:test($inputRoot1 as element(inputRoot))
    as element(ns0:outputRoot) {
    <ns0:outputRoot>
    <outputAccounts>
    <outputAccountName>{ data($inputRoot1/inputAccountName) }</outputAccountName>
    <outputAccountNumber>{ data($inputRoot1/inputAccountNumber) }</outputAccountNumber>
    </outputAccounts>
    </ns0:outputRoot>
    declare variable $inputRoot1 as element(inputRoot) external;
    xf:test($inputRoot1)
    Result
    <ns0:outputRoot xmlns:ns0="http://www.example.org/outputSchema">
         <outputAccounts>
              <outputAccountName>inputAccountName_1</outputAccountName>
              <outputAccountNumber>inputAccountNumber_1</outputAccountNumber>
         </outputAccounts>
    </ns0:outputRoot>
    How can I write the XQuery in such a way thay the namespace prefix isn't output? I've tried many different methods with no success. I can't declare a default element namespace because my input element doesn't have a namespace
    Thanks in advance

    I spoke too soon, it didn't work quite as perfectly as I'd thought :-) It turns out our client can't handle the xml with the namespace prefix but we've worked out the solution to return XML in the format we originally needed.
    Example below:
    XQuery
    declare namespace xf = "http://tempuri.org/XQueryProject/scratchTransformations/test/";
    declare default element namespace "http://www.example.org/outputSchema";
    declare namespace ns1 = ""
    declare function xf:test($inputRoot1 as element(ns1:inputRoot))
    as element(outputRoot) {
    <outputRoot>
    <outputAccounts>
    <outputAccountName>{ data($inputRoot1/inputAccountName) }</outputAccountName>
    <outputAccountNumber>{ data($inputRoot1/inputAccountNumber) }</outputAccountNumber>
    </outputAccounts>
    </outputRoot>
    declare variable $inputRoot1 as element(inputRoot) external;
    xf:test($inputRoot1)

  • How to parse XML document with default namespace with JDOM XPath

    Hi All,
    I am having difficulty parsing using Saxon and TagSoup parser on a namespace html document. The relevant content of this document are as follows:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    <body>
        <div id="container">
            <div id="content">
                <table class="sresults">
                    <tr>
                        <td>
                            <a href="http://www.abc.com/areas" title="Hollywood, CA">hollywood</a>
                        </td>
                        <td>
                            <a href="http://www.abc.com/areas" title="San Jose, CA">san jose</a>
                        </td>
                        <td>
                            <a href="http://www.abc.com/areas" title="San Francisco, CA">san francisco</a>
                        </td>
                        <td>
                            <a href="http://www.abc.com/areas" title="San Diego, CA">San diego</a>
                        </td>
                  </tr>
    </body>
    </html>
    Below is the relevant code snippets illustrates how I have attempted to retrieve the contents (value of  <a>):
                 import java.util.*;
                 import org.jdom.*;
                 import org.jdom.xpath.*;
                 import org.saxpath.*;
                 import org.ccil.cowan.tagsoup.Parser;
    ( 1 )       frInHtml = new FileReader("C:\\Tmp\\ABC.html");
    ( 2 )       brInHtml = new BufferedReader(frInHtml);
    ( 3 ) //    SAXBuilder saxBuilder = new SAXBuilder("org.apache.xerces.parsers.SAXParser");
    ( 4 )       SAXBuilder saxBuilder = new SAXBuilder("org.ccil.cowan.tagsoup.Parser");
    ( 5 )       org.jdom.Document jdomDocument = saxbuilder.build(brInHtml);
    ( 6 )       XPath xpath =  XPath.newInstance("/ns:html/ns:body/ns:div[@id='container']/ns:div[@id='content']/ns:table[@class='sresults']/ns:tr/ns:td/ns:a");
    ( 7 )       xpath.addNamespace("ns", "http://www.w3.org/1999/xhtml");
    ( 8 )       java.util.List list = (java.util.List) (xpath.selectNodes(jdomDocument));
    ( 9 )       Iterator iterator = list.iterator();
    ( 10 )     while (iterator.hasNext())
    ( 11 )     {
    ( 12 )            Object object = iterator.next();
    ( 13 ) //         if (object instanceof Element)
    ( 14 ) //               System.out.println(((Element)object).getTextNormalize());
    ( 15 )             if (object instanceof Content)
    ( 16 )                   System.out.println(((Content)object).getValue());
    ….This program would work on the same document without the default namespace, hence, it would not be necessary to include “ns” prefix along in the XPath statements (line 6-7) either. Moreover, I was using “org.apache.xerces.parsers.SAXParser” to have successfully retrieve content of <a> from the same document without default namespace in the past.
    I would like to achieve the following objectives if possible:
    ( i ) Exclude DTD and namespace in order to simplifying the parsing process. How this could be done?
    ( ii ) If this is not possible, how to include it in XPath statements (line 6-7) so that the value of <a> is picked up correctly?
    ( iii ) Would changing from “org.apache.xerces.parsers.SAXParser” to “org.ccil.cowan.tagsoup.Parser” make any difference as far as using XPath is concerned?
    ( iv ) Failing to exlude DTD, how to change the lookup of a PUBLIC DTD to a local SYSTEM one and include a local DTD for reference?
    I am running JDK 1.6.0_06, Netbeans 6.1, JDOM 1.1, Saxon6-5-5, Tagsoup 1.2 on Windows XP platform.
    Any assistance would be appreciated.
    Thanks in advance,
    Jack

    Here's an example of using a custom EntityResolver with the standard DocumentBuilder provided by the JDK. The code may or may not be similar for the parsers that you're using.
    import java.io.IOException;
    import java.io.StringReader;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.xml.sax.EntityResolver;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    public class ParseExamples
        private final static String COMMON_XML
            = "<music>"
            +     "<artist name=\"Anderson, Laurie\">"
            +         "<album>Big Science</album>"
            +         "<album>Strange Angels</album>"
            +     "</artist>"
            +     "<artist name=\"Fine Young Cannibals\">"
            +         "<album>The Raw & The Cooked</album>"
            +     "</artist>"
            + "</music>";
        private final static String COMMON_DTD
            = "<!ELEMENT music (artist*)>"
            + "<!ELEMENT artist (album+)>"
            + "<!ELEMENT album (#PCDATA)>"
            + "<!ATTLIST artist name CDATA #REQUIRED>";
        public static void main(String[] argv)
        throws Exception
            // this version uses just a SYSTEM identifier - note that it gets turned
            // into a file: URL
            String xml = "<!DOCTYPE music SYSTEM \"bar\">"
                       + COMMON_XML;
            // this version uses both PUBLIC and SYSTEM identifiers; the SYSTEM ID
            // gets munged, the PUBLIC ID doesn't
    //        String xml = "<!DOCTYPE music PUBLIC \"foo\" \"bar\">"
    //                   + COMMON_XML;
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setValidating(true);
            DocumentBuilder db = dbf.newDocumentBuilder();
            db.setEntityResolver(new EntityResolver()
                public InputSource resolveEntity(String publicId, String systemId)
                    throws SAXException, IOException
                    System.out.println("publicId = " + publicId);
                    System.out.println("systemId = " + systemId);
                    return new InputSource(new StringReader(COMMON_DTD));
            Document dom = db.parse(new InputSource(new StringReader(xml)));
            System.out.println("root element name = " + dom.getDocumentElement().getNodeName());
    }

  • Change the default namespace in soap message generated by webservice proxy

    I have a requirement where the default namespace generated by the webservice proxy has to be changed. For example, below is a soap request message generated by the proxy:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ns0="http://siebel.com/asi/"
    xmlns:ns1="http://www.siebel.com/xml/getAllSecurityValuesResponse/PS"
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <env:Header>
    <wsse:Security
    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
    xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    env:mustUnderstand="1"
    xmlns:xmlns="http://schemas.xmlsoap.org/soap/envelope/">
    <wsse:UsernameToken
    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
    xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <wsse:Username>kaoliver</wsse:Username>
    <wsse:Password
    Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">db2</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </env:Header>
    <env:Body>
    <ns0:SearchSecurityServicegetAllSecurityValues_1>
    <Login>kaoliver</Login>
    </ns0:SearchSecurityServicegetAllSecurityValues_1>
    </env:Body>
    </env:Envelope>
    In the above message, I want to change the oasis namespace to a different namespace. Where are the default namespaces defined in the proxy classes generated by Jdev so that I can change them?
    Thanks in advance,
    Warm Regards,
    Shashi Anand B

    >
    If I define a prefix P2L in the expression editor to correspond to "http://foo.com/namespace/business", I'm able to reference the ExecuteResponse element as "./P2L:ExecuteResponse", but then I get stuck.
    If I try use a Rename action to change the namespace for "./P2L:*", only the ExecuteResponse element is renamed to <sof:ExecutResponse xmlns:sof="http://foo.com/namespace/proxy">. Upstream in the calling application, there's an XML stream reader exception because (I assume) ExecuteResult is not found and parsed.
    >
    You pattern "./P2L:\*" matches just one element so it's ok that the payload's namespace wasn't touched. If you want to rename namespace for all elements try "//P2L:*". However, I'm not sure whether this is what you want. Try do describe what you do, what you want and what you get instead.
    >
    I also tried using a Replace action against "./P2L:ExecuteResponse/@xmlns" to replace its contents with "http://foo.com/namespace/proxy". I also tried "./P2L:ExecuteResponse/@P2L:xmlns". Neither worked.
    >
    I think it's not a good approach to replace content of xmlns as this attribute is not a common xml attribute.

Maybe you are looking for

  • How can I export my iMac Address Book to a file to be read by Outlook

    I am trying to export my address book to Outlook on a laptop (PC) and have tried all the export options and cannot export more than one Vcard at a time. In addition, I find that I cannot sync with my Yahoo Address Book as well.

  • Itunes is messed up

    so my itunes hasn't been working for a while. It won't transfer any new songs to my ipod, in fact for a while it wouldn't even recognize my ipod. Now it recognizes it but it told me that itunes wasn't installed properly. so I unintstalled it and re-i

  • 802.11n Enabler won't install

    I have a 2-week old MBP Core 2. When I run the installer I get; You cannot install...on this volume. This volume does not meet the requirements for this update. The installer reports 90.5GB Free on my only HD; the software requires 112KB. Anybody els

  • Adf: Get Id foreach

    Hi, In the code below I have 3 for each as master-detail(Clients-->Proyects-->Tasks), and the tasks are drag source components. I'm trying programmatically to get the value of the Id of each one on Drop, I'm able to get the "Name" of each item but I

  • No thumbnails/preview in Nautilus for files in a smb shared folder.

    Hi, This is a problem I have tried to solve for more than a year by posting in forums, trial and error and a lot of Google searches. For my work I have to look through large folders on a smb share with movie files. I need thumbnails/preview to be abl