Namespace declaration and W3C standart

Hello,
W3C has following specs for Namespace declaration in XQuery:
http://www.w3.org/TR/xquery/#id-namespace-decls
"[117]      NamespaceDecl      ::=      "declare" "namespace" NCName "=" StringLiteral
A namespace declaration declares a namespace prefix and associates it with a namespace
URI, adding the (prefix, URI) pair to the set of in-scope namespaces. The string
literal used in a namespace declaration must be a valid URI, and may not be a
zero-length string.[err:XQ0046] The namespace declaration is in scope throughout
the query in which it is declared, unless it is overridden by a namespace declaration
attribute in an element constructor.
The following query illustrates a namespace declaration:
declare namespace foo = "http://example.org";
<foo:bar> Lentils </foo:bar> "
BNF production grammar requires "declare" token to be placed before namespace,
while
Liquid Data reports parsing error if the word is there.
How close Liquid Data XQuery grammar to the W3C standart?
Also, does "of type" exist in XQuery ?
Sincerely,
Benjamin.

Thank you for quick answer.
Sorry, my fault - didn't notice that fact.
Benjamin.
"Mike Reiche" <mreiche@news_group_only.com> wrote:
LD 8.1 was released in July 2003 (before the August 2003 spec). It adheres
to
http://www.w3.org/TR/2001/WD-xquery-20011220/#id-namespace-decls-and-schemas
http://e-docs.bea.com/liquiddata/docs81/prodover/concepts.html
- Mike Reiche
"Benjamin Shrom" <[email protected]> wrote:
Hello,
W3C has following specs for Namespace declaration in XQuery:
http://www.w3.org/TR/xquery/#id-namespace-decls
"[117]      NamespaceDecl      ::=      "declare" "namespace" NCName
"=" StringLiteral
A namespace declaration declares a namespace prefix and associates it
with a namespace
URI, adding the (prefix, URI) pair to the set of in-scope namespaces.
The string
literal used in a namespace declaration must be a valid URI, and may
not be a
zero-length string.[err:XQ0046] The namespace declaration is in scope
throughout
the query in which it is declared, unless it is overridden by a namespace
declaration
attribute in an element constructor.
The following query illustrates a namespace declaration:
declare namespace foo = "http://example.org";
<foo:bar> Lentils </foo:bar> "
BNF production grammar requires "declare" token to be placed beforenamespace,
while
Liquid Data reports parsing error if the word is there.
How close Liquid Data XQuery grammar to the W3C standart?
Also, does "of type" exist in XQuery ?
Sincerely,
Benjamin.

Similar Messages

  • Add dynamic namespace declaration into xml root element

    Hello all,
    i've have two scenarios (mail to mail and file to file) with the same issue : no namespace in my XML file and i have to create one 'dynamically' from XML values.
    Example :
    <root>
    <name>test</name>
    <email>test</email>
    <schema>schemaID</schema>
    </root>
    Now I want to add infos into the root element for namespace declaration and so on, without expansion of the xsd. I've must use the value from the field schemaID.
    Example:
    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns: namespace="http://test.de/schemaID">
    <name>test</name>
    <email>test</email>
    </root>
    I've already done it before through XSLT but it wasn't dynamic !! I don't know how to do it in XSL and i am not a java expert.
    Someone got an idea ?
    Thanks,
    Jean-Philippe.

    Hi,
      If you want to add name space at mapping level two options
    1)Using XSLT Mapping ,its very easy,google it to get sample XSLT code ,it will solve your problem.
    2)Using java mapping,in java mapping use regular expression code ,using regex(Regulkar expresion)we can add any content in message at any level.
    Regards,
    Raj

  • Add a root node and namespace declaration

    According to the requirement,I have a large appended .txt file.
    This .txt file is created by appending various xml files (without the namespace and root node).
    I need to add a root node and namespace declaration to the large appended .txt file so that it can be read as .xml.
    Please provide the pointers for the same.
    Thanks & Regards,
    Rashi

    My appended file looks like following.
    <input>
       <Store>
          <StoreHeader>
             <StoreNbr>56</StoreNbr>
             <StoreType>Retail</StoreType>
             <StoreSite>2004</StoreSite>
          </StoreHeader>
          <Transactions>
             <Transaction>
                <Item>A</Item>
                <ItemPrice>4</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>C</Item>
                <ItemPrice>56</ItemPrice>
             </Transaction>
          </Transactions>
       </Store>
    </input>
    <input>
       <Store>
          <StoreHeader>
             <StoreNbr>123</StoreNbr>
             <StoreType>Retail</StoreType>
             <StoreSite>2004</StoreSite>
          </StoreHeader>
          <Transactions>
             <Transaction>
                <Item>A</Item>
                <ItemPrice>4</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>B</Item>
                <ItemPrice>8</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>C</Item>
                <ItemPrice>56</ItemPrice>
             </Transaction>
          </Transactions>
       </Store>
    </input>
    Now according to the requirement, I need to add namespace and root node and make it like follows:
    <ns0:output xmlns:ns0="http://xxx">
       <input>
       <Store>
          <StoreHeader>
             <StoreNbr>56</StoreNbr>
             <StoreType>Retail</StoreType>
             <StoreSite>2004</StoreSite>
          </StoreHeader>
          <Transactions>
             <Transaction>
                <Item>A</Item>
                <ItemPrice>4</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>C</Item>
                <ItemPrice>56</ItemPrice>
             </Transaction>
          </Transactions>
       </Store>
    </input>
    <input>
       <Store>
          <StoreHeader>
             <StoreNbr>123</StoreNbr>
             <StoreType>Retail</StoreType>
             <StoreSite>2004</StoreSite>
          </StoreHeader>
          <Transactions>
             <Transaction>
                <Item>A</Item>
                <ItemPrice>4</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>B</Item>
                <ItemPrice>8</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>C</Item>
                <ItemPrice>56</ItemPrice>
             </Transaction>
          </Transactions>
       </Store>
    </input>
    </ns0:output>

  • Oracle9i XMLType and namespace declaration

    Hi Folks,
    I am using the new XMLType for storing XML data and when I want to insert a XML document that contains a namespace declaration
    using sys.XMLType.createXML('<lom xmlns="http://www.imsglobal.org/xsd/imsmd_rootv1p2p1"...>...</lom>') function, nothing is inserted into the field and no error message is shown. If I remove the namespace declaration like: sys.XMLType.createXML('<lom>...</lom>') then it works.
    I am wondering if there is a problem with the XML Parser or I should do something that I don't. I have read most of the online documents in this regard but couldn't find any answer.
    Your help is really appreciated.
    Bahram Jalili

    I ran into the same (almost) problem a few weeks ago and posted a question to this forum - no response... sigh. Seems like a pretty obvious bug.

  • Avoid repeating namespace declaration in xml output

    Hi all,
    I'm trying an IDoc -> XML File (specifically UBL-format) scenario, and it is working fine. But the resulting XML contains repeating namespace declarations for each element, instead of a "common" declaration at the root element.
    How can I avoid this, so the message contains the namespace declarations in root node, and only uses the namespace prefix for each element?
    The target format, external definition, is an XSD with several import statements, and all external references have been set up, meaning all referenced XSD's are imported too, and have the "Source"-field set according to the import statement.
    Sample result file (top of file only):
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Invoice xmlns:ns0="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
    <ns2:UBLVersionID xmlns:ns2="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">2.0</ns2:UBLVersionID>
    <ns2:CustomizationID xmlns:ns2="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">urn:www.cenbii.eu:transaction:BiiCoreTrdm001:ver1.0:extentionId</ns2:CustomizationID>
    <ns2:ProfileID xmlns:ns2="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">urn:www.cenbii.eu:profile:bii05:ver1.0</ns2:ProfileID>
    <ns2:ID xmlns:ns2="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">9010045446</ns2:ID>
    <ns2:IssueDate xmlns:ns2="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">2011-04-19</ns2:IssueDate>
    <ns2:InvoiceTypeCode...
    PI version 7.11.
    Thanks for all help.
    Br,
    Kenneth

    Hi Mon,
    You can use below xslt 1.0 mappings.
    The first one will copy all namespaces (declared) to a newly created root element.
    The seconde one will delete the 'old' root element.
    => The result will look like an xml where the namespacesare moved to the root element.
    First xslt:
    <?xml version='1.0' encoding='utf-8'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="UTF-8"/>
    <xsl:template match="/">
    <Invoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ns1="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:ns3="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ns4="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
    <xsl:copy-of select="." />
    </Invoice>
    </xsl:template>
    </xsl:stylesheet>
    Second xslt:
    <?xml version='1.0' encoding='utf-8'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="UTF-8"/>
    <xsl:template match="@* | node()">
      <xsl:copy>
        <xsl:apply-templates select="@* | node()"/>
      </xsl:copy>
    </xsl:template>
    <xsl:template match="Invoice" >
      <xsl:apply-templates/>
    </xsl:template>
    </xsl:stylesheet>
    Kind regards,
    Lode

  • RFC Call: Missing namespace declaration

    Dear experts,
    I have a file to RFC scenario. I imported the RFC and create files exactly according to the RFC structure, so I don't use a mapping. When I create a file, it provides the following error in the adapter log:
    <i>Exception caught by adapter framework: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: could not get functionname from XML requst: com.sap.aii.af.rfc.RfcAdapterException: failed to read funtionname from XML document: missing namespace declaration(2)</i>
    What do I need to do to fix this.
    Thanks in advance!

    This is the whole message:
    I created my own interface and mapped it to the RFC:
    This is the message. Now it successfully pass XI and the adapter sais it is delivered.
    BUT nothing is seen in the target system... how is that possible???
    <?xml version="1.0" ?>
    <ns:MT_TO_CREATE xmlns:ns="urn://cchbc/w2/xi/mes/warehousetransfer">
    <LGNUM></LGNUM>
    <TIMEST>20071207094550.0000000</TIMEST>
    <WERKS>4510</WERKS>
    <ZLAST>0</ZLAST>
    <ZSCID>SCANPRD4</ZSCID>
    <I_LTAP>
    <item>
    <EAN11>5449000003096</EAN11>
    <LETYP>E2</LETYP>
    <VSOLM>48.000</VSOLM>
    <LENUM>00345101239500010930</LENUM>
    <VFDAT>2008-12-11T00:00:00</VFDAT>
    <WDATU>2007-12-07</WDATU>
    <ZLINE>830</ZLINE>
    <ZTIME>09:43:32</ZTIME>
    <BRGEW/>
    </item><item>
    <EAN11>2229000058744</EAN11>
    <LETYP>E2</LETYP>
    <VSOLM>48</VSOLM>
    <LENUM>00000000003000002961</LENUM>
    <VFDAT>2008-12-11T00:00:00</VFDAT>
    <WDATU>2007-12-07</WDATU>
    <ZLINE>830</ZLINE>
    <ZTIME>09:44:01</ZTIME>
    <BRGEW/></item><item>
    <EAN11>2229000058744</EAN11>
    <LETYP>E2</LETYP>
    <VSOLM>48.000</VSOLM>
    <LENUM>00000000003000002978</LENUM>
    <VFDAT>2008-12-11T00:00:00</VFDAT>
    <WDATU>2007-12-07</WDATU>
    <ZLINE>830</ZLINE>
    <ZTIME>09:44:32</ZTIME>
    <BRGEW/></item></I_LTAP></ns:MT_TO_CREATE>
    And the output is:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:ZWM_TO_CREATE xmlns:ns1="urn:sap-com:document:sap:rfc:functions">
      <LGNUM />
      <TIMEST>20071207094550.0000000</TIMEST>
      <WERKS>4510</WERKS>
      <ZLAST>0</ZLAST>
      <ZSCID>SCANPRD4</ZSCID>
    - <I_LTAP>
    - <item>
      <EAN11>5449000003096</EAN11>
      <LETYP>E2</LETYP>
      <VSOLM>48.000</VSOLM>
      <LENUM>00345101239500010930</LENUM>
      <VFDAT>2008-12-11T00:00:00</VFDAT>
      <WDATU>2007-12-07</WDATU>
      <ZLINE>830</ZLINE>
      <ZTIME>09:43:32</ZTIME>
      <BRGEW />
      </item>
    - <item>
      <EAN11>2229000058744</EAN11>
      <LETYP>E2</LETYP>
      <VSOLM>48</VSOLM>
      <LENUM>00000000003000002961</LENUM>
      <VFDAT>2008-12-11T00:00:00</VFDAT>
      <WDATU>2007-12-07</WDATU>
      <ZLINE>830</ZLINE>
      <ZTIME>09:44:01</ZTIME>
      <BRGEW />
      </item>
    - <item>
      <EAN11>2229000058744</EAN11>
      <LETYP>E2</LETYP>
      <VSOLM>48.000</VSOLM>
      <LENUM>00000000003000002978</LENUM>
      <VFDAT>2008-12-11T00:00:00</VFDAT>
      <WDATU>2007-12-07</WDATU>
      <ZLINE>830</ZLINE>
      <ZTIME>09:44:32</ZTIME>
      <BRGEW />
      </item>
      </I_LTAP>
      </ns1:ZWM_TO_CREATE>

  • How to remove SOAP namespaces declarations in body content?

    Hi!
    I'm calling a WS with WS-Security without problems but when I extract the content the SOAP message's Body(the "business" part), the namespace declarations of the SOAP part (envelope, security, etc.) are present in the root element. However, any of this namespaces is referenced in the message that I extract.
    I'm extracting the message inside the body like this
    XmlObject[] aXml = xml.selectPath(##THE QUERY##);
    return XmlObject.Factory.parse(aXml[0].xmlText(_opts));
    Is there a way of getting rid of these declarations?
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    I've tried changing the XmlOptions (setSaveAggresiveNamespaces, setLoadSubstituteNamespaces, etc.) without success.
    Thanks in advance!

    just use $body/* and you will have what u wanted.

  • Retrieve namespace  declarations from unmarshalled object

    Hi,
         I hope this is a beginner's question:
    Still working on a web service, that uses an EJB for implementation. I'm using types/classes that were derived automatically from a WSDL (top-down/outside-in/what have you), or rather the corresponding schemata. I'm trying to retrieve namespace declarations from the unmarshalled object/element, but  they are not contained in the "otherAttributes" [Map<QName, String>] member field of the respective object. However, I can retrieve any other attribute, qualified and non qualified, as long as the namespace isn't that of xmlns (http://www.w3.org/2000/xmlns/). For example:
    Client:
                MyElement my_element = new MyElement();
                Map<QName, String> atts = my_element.getOtherAttributes();
                QName ns_att = new QName("http://www.w3.org/2000/xmlns/", "a");
                atts.put(ns_att, "http://www.example.com/");
                QName test_att = new QName("test-att");
                atts.put(test_att, "http://www.example2.com");
    Service:
                MyElement my_element = parent.getMyElement(); // ...
                Map<QName, String> atts = my_element.getOtherAttributes();
                for (QName qn :  atts.keySet()) {
                    System.out.println("qn: ["+qn+"] value["+atts.get(qn)+"]");
    This would print:
    qn: [test-att] value[http://www.example2.com]
    What am I missing? How do I get the namespace declaration? Thanks for your help in advance.
    Cheers,
    Felix

    I'll try to explain in a better way ...
    I have a server with 2 different client and each client communicate to the server with a different interface.
    My needs are to recognize from the server, the type of the client that are operating, and to do this I was thinking to recognize the interface used from the client to interact with the server
    An other option is that, from the client, after retrieving the server and it's cast, a can call a method to pass to the server object, the type of the interface actually used.
    But I think this makes a bit of nonsense because When I receive the marshalled object in my opinion doesn't make sense that i have to say the object it's type (the interface used).
    the object is already alive and I think it has to know the interface used to refer it even if is on another VM
    The cast operation doesn't store nothing into the current object instance?
    local code example (I don't know if with JRMI the situation is different because the different JVM)
    Map foo = new HashTable();
    I need a method like
    foo.curretUsedInterface() ... that return "Map"
    instead of
    foo.getClass().getName() that return "HashMap"
    It's possible to obtain this information or I have to try another idea to make the server distinguish the client type?
    thank you very much for your comprehension

  • Unnecessary  Namespace declarations

    Hi,
    When mapping (graphic) to an externally defined XML schema where some elements belong to different namespaces I get namespace declarations on each element in the resulting XML instance even though they refer to the same ns name. The problem is that the XML document, even though valid, is very verbose. Is there a way to get all ns declarations in the root element instead without using XSLT?
    Example output
    <?xml version="1.0" encoding="utf-8" ?>
    <ns1:RootElement xmlns:ns1="http://foo.com">
    <ns2:Element1 xmlns:ns2="http://junk.com" />
    <ns2:Element2 xmlns:ns2="http://junk.com" />
    <ns2:Element3 xmlns:ns2="http://junk.com" />
    </ns1:RootElement>
    I would like to get something like this instead:
    <?xml version="1.0" encoding="utf-8" ?>
    <ns1:RootElement xmlns:ns1="http://foo.com" xmlns:ns2="http://junk.com">
    <ns2:Element1 />
    <ns2:Element2 />
    <ns2:Element3 />
    </ns1:RootElement>
    Kind regards Johan

    Hi,
    I was probably not clear enough in my question.
    My Scenario is CRM -> Xi -> External system.
    The inbound interface to the external system is a predefined XML Schema where not all components/elements belong to the same namespace.
    When executing a mapping, created with the graphical mapping tool in Xi, the resulting XML document/Instance is valid but very verbose since XI put namespace declarations in every element over and over again instead of just putting them once in the root element.
    I don't think this has anything to do with the XSD, but rather with the mapping program.
    The result is that the receiving system takes a performance hit. I would like to find a way to force XI to just declare the same ns once in the root element instead of over and over again?
    kind regards Johan

  • Duplicate namespace declarations when writing a file with JCA file adapter

    I am using JCA File adapter to write a an XML file. The composite contains a mediator which received and transforms an XML to desired format and then calls a JCA file adapter to write the file.
    The problem that I am having is that the written file has declaration of namespaces repeated with repeating elements instead of a single declaration at root. For ex.
    instead of
    <ns0:Root xmlns:ns0="namespace0"  xmlns:ns1="namespace1" xmlns:ns2="namespace2">
    <ns0:RepeatingChild>
    <ns1:Element1>value1</ns1:Element1>
    <ns2:Element2>value2</ns2:Element2>
    </ns0:RepeatingChild>
    <ns0:RepeatingChild>
    <ns1:Element1>value3</ns1:Element1>
    <ns2:Element2>value4</ns2:Element2>
    </ns0:RepeatingChild>
    </ns0:Root>What I see in the file is:
    <ns0:Root xmlns:ns0="namespace0"  xmlns:ns1="namespace1" xmlns:ns2="namespace2">
    <ns0:RepeatingChild>
    <ns1:Element1 xmlns:ns1="namespace1" xmlns:"namespace1">value1</ns1:Element1>
    <ns2:Element2 xmlns:ns2="namespace2" xmlns:"namespace2">>value2</ns2:Element2>
    </ns0:RepeatingChild>
    <ns0:RepeatingChild>
    <ns1:Element1 xmlns:ns1="namespace1" xmlns:"namespace1">>value3</ns1:Element1>
    <ns2:Element2 xmlns:ns2="namespace2" xmlns:"namespace2">>value4</ns2:Element2>
    </ns0:RepeatingChild>
    </ns0:Root>So basically all the elements which are in different namespace than root element have a namespace declaration repeated even though the namespace identifier is declared at the root elment level.
    Although, the XML is still valid, but this is unnecessarily increasing the filesizes 3-4 times. Is there a way I can write the XML file without duplicate declarations of namespaces?
    I am using SOA Suite 11.1.1.4
    The file adapter has the schema set as above XML.
    I tried the transformation in mediator using XSL and also tried using assign [source(input to mediator) and target(output of mediator, input of file adapter) XMLs are exactly same].
    but no success.

    I used automapper of JDeveloper to generate the schema. The source and target schema are exactly same.
    I was trying to figure it out and I observed that if the namespaces in question are listed in exclude-result-prefixes list in xsl, then while testing the XSL in jDeveloper duplicate namespaces occur in the target and if I remove the namespace identifiers from the exclude-result-prefixes list then in jDeveloper testing the target correctly has only a single namespace declaration at the root node.
    But, when I deployed the same to server and tested there, again the same problem.

  • CFFEED & Namespace Declaration

    I would appreciate some help with generating rss feed for Google Merchant.  I am trying to use cffeed to generate the xml file which I am good with.  The issue is formatting it to google's specifications and their namespace declaration (<g:price></g:rpice>)  how to set a xml structure to include g:  in front of the names?
    Here is a sample of googe xml structure:
    <?xml version="1.0"?>
    <rss version="2.0"
    xmlns:g="http://base.google.com/ns/1.0">
    <channel>
    <title>The name of your data feed</title>
    <link>http://www.example.com</link>
    <description>A description of your content</description>
    <item>
    <title>Red wool sweater</title>
    <link> http://www.example.com/item1-info-page.html</link>
    <description>Comfortable and soft, this sweater will keep you warm on those cold winter nights.</description>
    <g:image_link>http://www.example.com/image1.jpg</g:image_link>
    <g:price>25</g:price>
    <g:condition>new</g:condition>
    <g:id>1a</g:id></item>
    </channel>
    </rss>

    I had a google around, and as far as I can tell it cannot be done with <cffeed> (*).  Just use <cfxml> instead, I reckon.
    And maybe raise an issue with Adobe: http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html.  If you do so, and post the bug ref back here, I'll vote for it too :-)
    Adam
    (*) http://www.coldfusionjedi.com/index.cfm/2008/4/23/Ask-a-Jedi-Handling-RSS-feeds-with-custo m-data.  Ray's pretty clued up about these things, so I'd take his word for it.

  • About "using namespace std" and tool.h++

    Hi,
    I am a new starter working on some old code C++ using tools.h++ which was previous compiled under the 4.2 version. After reading early topics in this forum, I know that I can use in the new workshop 6 compiler by compiler options like "-library=rwtools7, iostream" to enable usage of both standard iostreams and classic iostreams, however I have problem with "using namespace std", which is plenty in original codes, even the following simple code won't pass: CC -library=rwtools7,iostream test1.cc
    File: test1.cc
    using namespace std;
    #include <rw/rwstring.h>
    #include <iostream>
    #include <string>
    int main()
    RWCString s1("hello");
    string s2("world");
    cout<<s1<<s2<<endl;
    return 0;
    error code is :
    Error :the name cout is ambiguous, cout and std::cout
    Error: The operation "ostream << std::basic_string<char, std::char_traits<char>, std::allocator<char>>" is illegal
    but if I marked "using namespace std" and replace cout with std::cout, everything works fine.
    Thanks for the time.
    PS: when I use -library=rwtools7_std, a CC warning of illegal option -library=rwtools7_std ignored, am I missing something in the system?

    The C++ Standard Library, which you access by using headers such as <iostream> and <string>, does not mix well with classic iostreams.
    One problem is that classic iostreams has identifiers that are the same as identifiers in standard iostreams, but in different namespaces. If you add
    using namespace std;
    to your code, you create conflicts among the names.
    In general, "using namespace std;" is a Bad Idea in real applications. The standard library has so many names that you are likely to run into conflicts with names declared elsewhere. You can add individual using-declarations for types that you need, or qualify them explicitly.
    #include <string>
    #include <list>
    using std::string;
    std::list<string> ListOfString;
    When mixing classic iostreams with the standard library, you cannot have any using-declaration or using-definition associated with names from either iostream library -- the names will conflict.
    If you want to use the standard library with Tools.h++, we recommend not using classic iostreams at all. Use the option
    -library=rwtools7_std
    to get a version of Tools.h++ that works with the standard library.
    Most simple iostream code works with both classic and standard iostreams, so this technique is worth a try. With luck, either you won't have to modify your source code at all, or the needed changes will be simple.
    You mention you are using the "new WorkShop 6" compiler. Workshop 6 is over 5 years old, and was long ago declared End Of Life. No support is available for it. Maybe you mean WorkShop 6 update 2, which was released in 2001, and which has just been declared End Of Life. WS6u2 is the earliest version that supports the -library=rwtools7_std option.
    In any case, you should look into upating to a current compiler.
    http://www.sun.com/software/products/studio/index.xml
    The current release is Sun Studio 10, listed here. But Sun Studio 11 will be released in two weeks. Watch that space (and this forum) for an announcement.
    The C++ MIgration Guide that comes with the compiler explains every issue you can run into when porting code from C++ 4.2 to C++ 5.x in standard mode. It also shows you how to modify code when necessary to get the proper result.

  • Inclusion of unused namespace declarations in marshalled XML

    Hello.
    I have noticed that by default any XML marshaled from an object contains namespace declarations related to every package specified when instantiating the JAXBContext even though they are not used in the instance being marshalled.
    Is there any way to avoid this during the marshalling as opposed to via some sort of post processing (e.g. XSLT transform).
    Example source below:
    package test;
    import javax.xml.bind.*;
    import java.io.*;
    import test.sample1.*;
    import test.sample2.*;
    public class Converter {
         public static void main(String[] args) {
              try {
                   String sample1 = "<Message1 xmlns=\"http://www.example.org/sample1\">" +
                                             "<tns:Field xmlns:tns=\"http://www.someother.org\">value</tns:Field>" +
                                        "</Message1>";
                   String sample2 = "<Message2 xmlns=\"http://www.example.org/sample2\">" +
                                            "<Field1>value1</Field1>" +
                                            "<Field2>value2</Field2>" +
                                        "</Message2>";
                   JAXBContext ctx = JAXBContext.newInstance("test.sample1:test.sample2");
                   Unmarshaller um = ctx.createUnmarshaller();
                   Marshaller m = ctx.createMarshaller();
                   StringWriter sw1 = new StringWriter();                
                   Message1 msg = (Message1)um.unmarshal(new StringReader(sample1));
                   m.marshal(msg, sw1);               
                   System.out.println("Marshalled sample1: \n"+sw1.toString());
                   StringWriter sw2 = new StringWriter();                
                   Message2 msg2 = (Message2)um.unmarshal(new StringReader(sample2));
                   m.marshal(msg2, sw2);               
                   System.out.println("Marshalled sample2: \n"+sw2.toString());
              } catch (JAXBException e) {
                   e.printStackTrace();
    }Produces output:-
    Marshalled sample1:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><Message1 xmlns:ns2="http://www.example.org/sample2" xmlns="http://www.example.org/sample1"><tns:Field xmlns:tns="http://www.someother.org">value</tns:Field></Message1>
    Marshalled sample2:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:Message2 xmlns:ns2="http://www.example.org/sample2" xmlns="http://www.example.org/sample1"><ns2:Field1>value1</ns2:Field1><ns2:Field2>value2</ns2:Field2></ns2:Message2>

    Thanks for the quick response. I really appreciate it.
    Yes, as you say, there is no real problem as such but part of my app lets the user see the RAW message XMLs and this could confuse them and would be tidier to remove but I can also see why it is easier from the Marshaller perspective not to have to back track to remove unused declarations.
    Also, I'm a little concerned about the increased size of the XML produced. One of my webservices does handle quite a few different types and our Oracle namespace URLs are all pretty long!
    Like I say, I can see a way to get rid of them after the fact but wondered if there was a more elegant/performant way.

  • Problem accessing /config_general/null/Default.action   Reason:There is no Action mapped for namespace/ config_general and action name default

    in use:
    vRO 5.1
    eclipse 3.7.2
    vRo plug-sdk 5.1
    steps:
    1.create a plug-in project from samples(choose solar system)
    2.find the dar package and upload it by vRo configuration
    3.vRo configuration said upload successfully,but the solar system configuration is not properly configued..
    problem:
    Problem accessing /config_general/null/Default.action   Reason:There is no Action mapped for namespace/ config_general and action name default
    How to solve it??
    Thanks so much!!

    There was problem from crm side...its working now..

  • Namespace declarations

    I have an XML file that declares some namespaces in its root
    element, like this:
    <config-ui xmlns='ocfgui.dtd'
    xmlns:cfg='ocfg.dtd'>
    |
    (innards deleted)
    |
    </config-ui>
    When I run this though the Oracle XMLParser v2.0.0 with
    validation on, I get "Illegal attribute name" errors on the
    namespace declarations. It's true that they're not in my DTD,
    but I didn't think the DTD had to specify xmlns attributes on
    every element that could use them. I thought that as reserved
    attribute names, they were implicitly valid on any element. Can
    someone set me straight on this?
    null

    David, see http://www.jclark.com/xml/xmlns.htm which states that
    the XML Namespaces Recommendation doesn't define additional
    validity distinct from XML 1.0 validity, so the behavior of our
    parsers is correct. There are two ways you can minimize size of
    your document. Either namespace scoping/defaulting, or attribute
    defaulting. See also section 5 of the following:
    http://www.w3.org/TR/1999/REC-xml-names-19990114/
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    David Kulik (guest) wrote:
    : I have an XML file that declares some namespaces in its root
    : element, like this:
    : <config-ui xmlns='ocfgui.dtd'
    : xmlns:cfg='ocfg.dtd'>
    : |
    : (innards deleted)
    : |
    : </config-ui>
    : When I run this though the Oracle XMLParser v2.0.0 with
    : validation on, I get "Illegal attribute name" errors on the
    : namespace declarations. It's true that they're not in my DTD,
    : but I didn't think the DTD had to specify xmlns attributes on
    : every element that could use them. I thought that as reserved
    : attribute names, they were implicitly valid on any element.
    Can
    : someone set me straight on this?
    null

Maybe you are looking for

  • PDF not displaying in Web Order Center?

    We copied a PROD system into a test system I'll call DDB01. The SAP logic creates the PDF file in UNIX. ITS gets the file and pits it on the server. We can see both. Via IE6 we cannot display the PDF. However, we can display the PDF using the same IE

  • Flex SDK Error

    I'm trying to setup the Flex SDK locally (the bugquash event over the weekend inspired me) and have got everything installed except I'm getting 2 errors after I import all of the sample projects: 1012: The static attribute may be used only on definit

  • Why currency factor can be happened.

    Dear folks,, Could you share about your experience regarding my question ?? I have pricing report where it display currency convertion. In that report, there column/field about local price value (e.g. IDR/JPY/EUR), beside that, it's also <b>USD price

  • My camera on my iphone4s wont work

    my front camera on my iphone 4s will not work.  Help

  • Custom button in IE

    We have a custom button created in plugin and it works fine in reader and acrobat. Now we want to make it available when the pdf opened in IE. The problem is when the pdf opened in IE the Extended tab is not displayed(the custom button is under this