XML version attribute

I am writing java through lotus notes. In it I go out and hit a web service and return the xml data. Once in the xml I use a transformer but I get the following error:
javax.xml.transform.TransformerException: stylesheet requires attribute: version
The code that I have does work when I use my xml as a file instead of in from the web service. I can not find anything that makes tis work. Before I had written this in lotusscript and used the ls2j connector and it worked fine (until the JVM would blow up) so we are dropping the connector and writing it all in java. Here is my code to work with the transformer....
import java.io.StringReader;
import java.io.StringWriter;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.apache.xalan.processor.*;
import javax.xml.parsers.*;
import javax.xml.transform.dom.*;
import org.w3c.dom.*;
* This class allows you to apply an XSL style sheet against an XML string from within the Lotus Notes environment, without having to place an XSL file on the file system or use a Java Agent.
* Xalan-Java 2.5.0 is required.  It can be downloaded from http://xml.apache.org/xalan-j/ .
* The JavaUserClasses variable in the Lotus Notes notes.ini file must reflect the jar files from Xalan.
public class clsNotesXSLTNTS extends Object
    private String strXml;
    private String strXsl;
    private String strXslUrl;
      * Empty Constructor.
      * @see java.lang.Object#Object()
    public clsNotesXSLTNTS     ()
         super();
      * This method will return the resultant transformation.
      * A url is the default source for the xsl file which is set using setXslUrl().  If it is not found a String input is assumed which is set using setXsl().
      * If a xsl url or a xsl String is not provided, null will be returned.
      * @return String
    public String process() {
        try
               StringReader srXSL;
               StringReader srXML = new StringReader(strXml);
               StringWriter sw = new StringWriter();
                  StreamSource ssXSL;
             TransformerFactory factory = null;
            Transformer transformer = null;
             // determine the source xsl type
             if (this.strXslUrl != null) {
                  ssXSL = new StreamSource(this.strXslUrl);
             else if (this.strXsl != null) {
                  srXSL = new StringReader(strXsl);
                  ssXSL = new StreamSource(srXSL);
             else {
                  return null;
                  // set the sax driver
//                  System.setProperty("org.xml.sax.driver", "org.apache.xerces.parsers.SAXParser");
             try {
                  // create a new factory
          transformer = factory.newTransformer(ssXSL);
             catch(Exception e) {
                  System.out.println("Unable to create Transformer Factory: " + e.getMessage());
             try {           
                 // create a new transformer
                    transformer = factory.newTransformer(ssXSL);
             catch(Exception e) {
                  System.out.println("Unable to create Transformer:" + e.getMessage());
            // get the source xml
            StreamSource xmlsource = new StreamSource(srXML);
            // create a stream for the result of the transformation
            StreamResult output = new StreamResult(sw);
            // transform the input xml using the input xsl
            transformer.transform(xmlsource, output);
               // return the resultant transformation
               return sw.toString();
//          return strXml;
        catch(Exception e)
             e.printStackTrace();
//             System.out.println(strXml);
            return null;
      * Gets the XML string that is to be transformed.
      * @return String
    public String getXml() {
        return strXml;
      * Sets the XML string that is to be transformed.
      * @param pstrXml The XML string.
    public void setXml(String pstrXml) {
        this.strXml = pstrXml;
      * Gets the XSL string that is used to transform the XML string.
      * @return String
     public String getXsl() {
          return strXsl;
      * Sets the XSL string that is used to transform the XML string.
      * @param pstrXsl The XSL string.
     public void setXsl(String pstrXsl) {
          this.strXsl = pstrXsl;
      * Gets the URL of the XSL file that is used to transform the XML string.
      * @return String
     public String getXslUrl() {
          return strXslUrl;
      * Sets the URL of hte XSL file that is used to transform the XML string.
      * @param pstrXslUrl The URL of the XSL file.
     public void setXslUrl(String strXslUrl) {
          this.strXslUrl = strXslUrl;
}to set the XML I use the following code:
          clsNotesXSLTNTS  JXSLT;
          JXSLT = new clsNotesXSLTNTS();
          JXSLT.setXslUrl(strXSLPath);
          JXSLT.setXml(XMLData);
          XMLData = JXSLT.process();where the XMLData is returned from the web services, here is an example file that I printed out to the browser and saved. If I use this file it works, but if I do not put it out to the file system then it does not work.
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<getInfoByPartialNameSpmpy004Response xmlns="http://tempuri.org/"><getInfoByPartialNameSpmpy004Result>
<params xmlns="http://tempuri.org/"><baseTarget>MainFrame</baseTarget><onLoadFunction>PostLoad()</onLoadFunction><formName>InquirySelection</formName><filePath>C:/notes/data/aptestCOPY.nsf</filePath><isUser>1</isUser><isNewForm>0</isNewForm><searchVendors>1</searchVendors><vendorSearchString>SHER</vendorSearchString><printVendorSelection>1</printVendorSelection><tableBGColor>#FFFEAD</tableBGColor><THClass>normal</THClass><TDClass>normal</TDClass></params><anyType xsi:type="clsVendorInfo"><blnFound>true</blnFound><strNumber>4603232                                                     </strNumber><strName>HOTEL Name       </strName><strAddr1>18TH AT Smoothie ST                       </strAddr1><strAddr2>                                        </strAddr2><strCity>Somewhere             </strCity><strState>PA </strState></anyType></getInfoByPartialNameSpmpy004Result></getInfoByPartialNameSpmpy004Response></soap:Body></soap:Envelope>This file was generated by calling the web service with the program and then printing it out to the browser and cut and paste. Anyone with any thoughts ????
Thanks in advance

I left off the first part of my XSL...
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ap="http://tempuri.org/" version = "1.0">
     <xsl:strip-space elements="*" />
     <xsl:output method="html" encoding="utf-8"/>

Similar Messages

  • Reg : xml version attribute in xml

    Hi, van body tell me what is the significance of version attribute.
    sometimes we use 1.0 , some times we use 4.0.
    2 ) encoding attribute...? when we use UTF , ISO. and tell me among the
    version , encoding which are mandatory, optional.
    <?xml....?> --tag is optinal or not                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    The version attribute specifies the version of the XML standard you are using. 4.0 is not a valid version. You get 1.0 or (maybe if the parser supports it), 1.1. There is no XML version 4.0.
    This value is not to be used for versioning your documents within your application context but is for parsers to determine which version of XML they must comply with when parsing your document.
    See the prolog section in the XML specification:
    http://www.w3.org/TR/xml/#sec-prolog-dtd
    The encoding lets your parser know how the document's bytes were encoded so it can decode them properly. A simple google search for info on the encoding types, UTF-8, UTF-16, ISO-8859-1, etc. will tell you all you need to know.
    Finally, the declaration <?xml ...?> is optional but recommended. Not only is it good practice, but it will ensure maximum portability of your documents (some parsers will reject the doc if you don't have it).

  • SmartForm Spool: Line missing: ?xml version="1.0" encoding="utf-8" ? sf

    Hello all,
    The spools of a SmartForm that I developed are missing the line:
    <?xml version="1.0" encoding="utf-8" ?><sf>
    The spool starts with:
    <smartxsf xmlns="urn:sap-com:SmartForms:2000:xsf"><header><general><version>1.14.2<  (so on...)
    The Functional Counsultant wants the spool to look like:
    <?xml version="1.0" encoding="utf-8" ?><sf><smartxsf xmlns="urn:sap-com:SmartForms:2000:xsf"><header><general><version>1.14.2<  (so on...)
    Only such a spool can be printed successfully. If the line is missing, no print out can be taken.
    Could you please tell me what settings need to be done in order to see the missing line in the spools?
    Thanks and regards,
    Ameya
    Edited by: Ameya_Tulpule on Mar 9, 2011 8:58 AM

    hii,
    http://help.sap.com/saphelp_nw70/helpdata/en/a5/28d3b6d26211d4b646006094192fe3/content.htm
    Go to this link click under Activating XSF Output
    statically
    dynamically
    Overriding the Output Format
    Desired Output Format
    Settings for Overriding
    Standard output
    (OTF)
    XSFCMODE = 'X'.
    XSF = SPACE.
    XDFCMODE = 'X'.
    XDF = SPACE.
    XSF
    XSFCMODE = 'X'.
    XSF = 'X'.
    XDFCMODE = SPACE.
    XSF+HTML
    XSFCMODE = 'X'.
    XSF = 'X'.
    XSFFORMAT = 'X'.
    XDFCMODE = SPACE.
    XDF
    XDFCMODE = 'X'.
    XDF = 'X'.
    XSFCMODE = SPACE.
    Matching Parameters for Static Attributes
    Output Format
    Input Field in Form
    Parameter of Structure SSFCOMPOP
    (possible settings)
    XSF
    Output mode
    (for XDFOUTMODE='S')
    XSFOUTMODE ('S'|'A')
      Output device
    XSFOUTDEV
    XSF+HTML
    Output mode
    XSFOUTMODE ('A')
      BSP page/URL
    XSFACTION
    XDF
    Output mode
    XDFOUTMODE ('S'|'A')
      Output mode
    (for XDFOUTMODE='S')
    XDFOUTDEV
    regards,
    Sridhar.V

  • WebService response object in XML - parsing attributes

    Hi- new to Flex and I'm trying to parse out the attributes of the response object. I can get the entire object and see that its working, but I cant get just a single attribute. It pulls weather info for world cities. For example, I just want the location name and temperature.
    Any advice on this? Thanks!
    <?xml version="1.0"?>
    <!-- fds\rpc\RPCResultFaultMXML.mxml -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                    xmlns:s="library://ns.adobe.com/flex/spark">
        <mx:Script>
            <![CDATA[
                import mx.rpc.soap.SOAPFault;        
                import mx.rpc.events.ResultEvent;
                import mx.rpc.events.FaultEvent;
                import mx.controls.Alert;
                import mx.utils.ObjectUtil;
                public function showErrorDialog(event:FaultEvent):void {
                    // Handle operation fault.
                    Alert.show(event.fault.faultString, "Error");
                public function defaultFault(event:FaultEvent):void {
                    // Handle service fault.
                    if (event.fault is SOAPFault) {
                        var fault:SOAPFault=event.fault as SOAPFault;
                        var faultElement:XML=fault.element;
                        // You could use E4X to traverse the raw fault element returned in the SOAP envelope.
                    Alert.show(event.fault.faultString, "Error");              
                public function log(event:ResultEvent):void {
                    // Handle result.
                    trace(event.result);
                    //trace(ObjectUtil.toString(event.result));
                    //var len:int;
                    //len = event.result.length;
                    //trace(len);
                    //trace(event.result);
                    //trace(event.result.GetWeatherResponse.Location);
                    //var myXML:XML = new XML(event.result);
                    //trace(myXML.attribute("Location"));
            ]]>
        </mx:Script>
        <mx:WebService id="WeatherService" wsdl="http://www.webservicex.com/globalweather.asmx?wsdl"
                       fault="defaultFault(event)">
            <mx:operation name="GetWeather"
                          fault="showErrorDialog(event)"
                          result="log(event)"
                          resultFormat="xml">
                <mx:request>
                    <CityName>{myCity.text}</CityName>
                    <CountryName>{myCountry.text}</CountryName>
                </mx:request>
            </mx:operation>
        </mx:WebService>
        <mx:TextInput id="myCity" text="Madrid"/>
        <mx:TextInput id="myCountry" text="Spain"/>
        <!-- Call the web service operation with a Button click. -->
        <mx:Button width="60" label="Get Weather"
                  click="WeatherService.GetWeather.send();"/>
        <!-- Display the Weather -->
        <mx:Label text="Weather:"/>
        <mx:TextArea text="{WeatherService.GetWeather.lastResult}" height="200"/>
    </mx:Application>

    The WSDL says GetWeatherResponse is a string, and it appears to be a string of XML, so set <mx:operation resultFormat="object"> as this will unwrap the SOAP response value and leave a string typed value intact. You can then create a new ActionScript 3.0 E4X-based XML instance from the unwrapped string:
        var myXML:XML = new XML(event.result.toString());
    You can then travese the XML document using E4X syntax, a simple example is included below:
        trace(myXML..Location);
        trace(myXML..Temperature);

  • XML Parsing attributes with encoded ampersand causes wrong order

    Hi all,
    I am writing in the forum first (because it could be that i am doing something wrong.... but i think it is a bug. Nonetheless, i thought i'd write my problem up here first.
    I am using Java 6, and this has been reproduced on both windows and linux.
    java version "1.6.0_03"
    Problem:
    read XML file into org.w3c.dom.Document.
    XML File has some attributes which contain ampersand. These are escaped as (i think) is prescribed by the rule of XML. For example:
    <?xml version="1.0" encoding="UTF-8"?>
         <lang>
              <text dna="8233" ro="chisturi de plex coroid (&gt;=1.5 mm)" it="Cisti del plesso corioideo(&gt;=1.5mm)" tr="Koro&#305;d pleksus kisti (&gt;=1.5 mm)" pt_br="Cisto do plexo cor&oacute;ide (&gt;=1,5 mm)" de="Choroidplexus Zyste (&gt;=1,5 mm)" el="&Kappa;&#973;&sigma;&tau;&epsilon;&iota;&sigmaf; &chi;&omicron;&rho;&omicron;&epsilon;&iota;&delta;&omicron;&#973;&sigmaf; &pi;&lambda;&#941;&gamma;&mu;&alpha;&tau;&omicron;&sigmaf; (&gt;= 1.5 mm)" zh_cn="&#33033;&#32476;&#33180;&#22218;&#32959;&#65288;&gt;= 1.5 mm&#65289;" pt="Quisto do plexo coroideu (&gt;=1,5 mm)" bg="&#1050;&#1080;&#1089;&#1090;&#1072; &#1085;&#1072; &#1093;&#1086;&#1088;&#1080;&#1086;&#1080;&#1076;&#1085;&#1080;&#1103; &#1087;&#1083;&#1077;&#1082;&#1089;&#1091;&#1089; (&gt;= 1.5 mm)" fr="Kystes du plexus choroide (&gt;= 1,5 mm)" en="Choroid plexus cysts (&gt;=1.5 mm)" ru="&#1082;&#1080;&#1089;&#1090;&#1099; &#1089;&#1086;&#1089;&#1091;&#1076;&#1080;&#1089;&#1090;&#1099;&#1093; &#1089;&#1087;&#1083;&#1077;&#1090;&#1077;&#1085;&#1080;&#1081; (&gt;=1.5 mm)" es="Quiste del plexo coroideo (&gt;=1.5 mm)" ja="&#33032;&#32097;&#33180;&#22178;&#32990;&#65288;&gt;=1.5mm&#65289;" nl="Plexus choroidus cyste (&gt;= 1,5 mm)" />
    </lang>As you might understand, we need to have the fixed text '>' for later processing. (not the greater than symbol '>' but the escaped version of it).
    Therefore, I escape the ampersand (encode?) and leave the rest of the text as is. And so my > becomes >
    All ok?
    Symptom:
    in fetching attributes, for example by the getAttribute("en") type call, the wrong attribute values are fetched.
    Not only that, if i only read to Document instance, and write back to file, the attributes are shown mixed up.
    eg:
    dna: 8233, ro=chisturi de plex coroid (>=1.5 mm), en=&#1082;&#1080;&#1089;&#1090;&#1099; &#1089;&#1086;&#1089;&#1091;&#1076;&#1080;&#1089;&#1090;&#1099;&#1093; &#1089;&#1087;&#1083;&#1077;&#1090;&#1077;&#1085;&#1080;&#1081; (>=1, de=Choroidplexus Zyste (>=1,5 mm)Here you can see that 'en' is shown holding what looks like greek, ... (what is ru as a country-code anyway?) where it should have obviously had the english text that originally was associated with the attribute 'en'
    This seems very strange and unexpected to me. I would have thought that in escaping (encoding) the ampersand, i have fulfilled all requirements of me, and that should be that.
    There is also no error that seems to occur.... we simply get the wrong order when fetching attributes.
    Am I doing something wrong? Or is this a bug that should be submitted?
    Kind Regards, and thanks to all responders/readers.
    Sean
    p.s. previously I had not been escaping the ampersand. This meant that I lost my ampersand in fetching attributes, AND the attribute order was ALSO WRONG!
    In fact, the wrong order was what led me to read about how to correctly encode ampersand at all. I had been hoping that correctly encoding would fix the order problem, but it didn't.
    Edited by: svaens on Mar 31, 2008 6:21 AM

    Hi kdgregory ,
    Firstly, sorry if there has been a misunderstanding on my part. If i did not reply to the question you raised, I appologise.
    In this 'reply' I hope not to risk further misunderstanding, and have simply given the most basic example which will cause the problem I am talking about, as well as short instructions on what XML to remove to make the problem disappear.
    Secondly, as this page seems to be displayed in ISO 8859-1, this is the reason the xml I have posted looks garbled. The xml is UTF-8. I have provided a link to the example xml file for the sample below
    [example xml file UTF-8|http://sean.freeshell.org/java/less2.xml]
    As for your most recent questions:
    Is it specified as an entity? To my knowledge (so far as my understanding of what an entity is) , yes, I am including entities in my xml. In my below example, the entities are the code for the greater than symbol. I am under the understanding that this is allowed in XML ??
    Is it an actual literal character (0xA0)? No, I am specifying 'greater than' entity (code?) in order to include the actual symbol in the end result. I am encoding it in form 'ampersand', 'g character', 't character', 'colon' in order for it to work, according to information I have read on various web pages. A quick google search will show you where I got such information from, example website: https://studio.tellme.com/general/xmlprimer.html
    Here is my sample program. It is longer than the one you kindly provided only because it prints out all attributes of the element it looks for. To use it, only change the name of the file it loads.
    I have given the xml code seperately so it can be easily copied and saved to file.
    Results you can expect from running this small test example?
    1. a mixed up list of attributes where attribute node name no longer matches its assigned attribute values (not for all attributes, but some).
    2. removing the attribute bg from the 'text' element will reduce most of these symptoms, but not all. Removing another attribute from the element will most likely make the end result look normal again.
    3. No exception is thrown by the presence of non xml characters.
    IMPORTANT!!! I have only just (unfortunately) noticed what this page does to my unicode characters... all the the international characters get turned into funny codes when previewed and viewed on this page.
    Whereas the only codes I am explicitly including in this XML is the greater than symbol. The rest were international characters.
    Perhaps that is the problem?
    Perhaps there is an international characters problem?
    I am quite sure that these characters are all UTF-8 because when I open up this xml file in firefox, It displays correctly, and in checking the character encoding, firefox reports UTF-8.
    In order to provide an un-garbled xml file, I will provide it at this link:
    link to xml file: [http://sean.freeshell.org/java/less2.xml]
    Again, sorry for any hassle and/or delay with my reply, or poor reply. I did not mean to waste anyones time.
    It will be appreciated however if an answer can be found for this problem. Chiefly,
    1. Is this a bug?
    2. Is the XML correct? (if not, then all those websites i've been reading are giving false information? )
    Kindest Regards,
    Sean
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NamedNodeMap;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.InputSource;
    public class Example
        public static void main(String[] argv)
              try
                   FileInputStream fis = new FileInputStream("/home/sean/Desktop/chris/less2.xml");
                 Document doc = DocumentBuilderFactory.newInstance()
                 .newDocumentBuilder()
                 .parse(new InputSource(fis));
                   Element root = doc.getDocumentElement();
                   NodeList textnodes = root.getElementsByTagName("text");
                   int len = textnodes.getLength();
                   int index = 0;
                   int attindex = 0;
                   int attrlen = 0;
                   NamedNodeMap attrs = null;
                   while (index<len)
                        Element te = (Element)textnodes.item(index);
                        attrs = te.getAttributes();
                        attrlen = attrs.getLength();
                        attindex = 0;
                        Node node = null;
                        while (attindex<attrlen)
                             node = attrs.item(attindex);          
                             System.out.println("attr: "+node.getNodeName()+ " is shown holding value: " + node.getNodeValue());
                             attindex++;                         
                        index++;
                        System.out.println("-------------");
                 fis.close();
              catch(Exception e)
                   System.out.println("we've had an exception, type "+ e);
    }  [example xml file|http://sean.freeshell.org/java/less2.xml]
    FOR THE XML, Please see link above, as it is UTF-8, and this page is not. Edited by: svaens on Apr 7, 2008 7:03 AM
    Edited by: svaens on Apr 7, 2008 7:23 AM
    Edited by: svaens on Apr 7, 2008 7:37 AM
    Edited by: svaens on Apr 7, 2008 7:41 AM

  • A version attribute is required, but this  version of the Weblogic Server

    Hello,
    I am seeing below error in my weblogic server logs couple of times in a day. I have gone through couple of blogs and seems this error is related to weblogic patch.
    Could someone please help me understand what exactly this error represent to and what could be impact because of this. So far we dont see any issue in our development enviroment but want to fix this error.
    we are using WLS 10.3.5
    Error :-
    <Feb 7, 2013 1:03:03 PM EST> <Warning> <Munger> <BEA-2156203> <A version attribute was not found in element application in the deployment descriptor in
    Oracle/Middleware/user_projects/domains/osb_domain/sbgen/_ALSB_1360084990664.ear/META-INF/application.xml. A version attribute is required, but this
    version of the Weblogic Server will assume that the JEE5 is used. Future versions of the Weblogic Server will reject descriptors that do not specify the JEE
    version.>

    Yes. It is a bug!!!
    Apply the patch for bug 11720907.
    1. Download the patch
    Sign in in My Oracle Support. Choose Patches & Updates
    Type 11720907 in textfield 'Patche Name or Number'
    This is the path:
    Patch 11720907: SU Patch [2IE6]: <A VERSION ATTRIBUTE WAS NOT FOUND IN ELEMENT PERSISTENCE ..>
    2. Appy the path using Smart Update

  • What is the use of version attribute in jnlp tag??

    Hello,
    I want to know what is the use of version attribute in jnlp tag.
    For ex:
    <jnlp spec="6.0+" codebase="$$codebase" href="$$name" version="1.1">
    </jnlp>
    In the spec it explains:
    In the Jnlp tag:
    version = The version of the application being launched, as well as the version of the JNLP file itself.
    1. Is this version attribute would work as version attribute in jar tag. Ex: <jar href="application.jar" version="1.1"/> ?
    i.e. can we specify different jnlp's with the same name as we do for jar's with the help of version.xml.
    Any help is greatly appreciated.
    //Anjali

    Hi Reddy,
    If one Info Object depends on another info object we will make that dependent info object as a compounding attribute of main Info object.
    Eg: Storage Location – Plant
    In above eg there is no meaning of Storage Location without Plant. So, we will make storage location as compounding attribute of Plant.
    Regards,
    Sreehari.

  • XMLTABLE function not returning any values if xml has attribute "xmlns"

    Hi,
    XMLTABLE function not returning any values if xml has attribute "xmlns". Is there way to get the values if xml has attribute as "xmlns".
    create table xmltest (id number(2), xml xmltype);
    insert into xmltest values(1,
    '<?xml version="1.0"?>
    <emps>
    <emp empno="1" deptno="10" ename="John" salary="21000"/>
    <emp empno="2" deptno="10" ename="Jack" salary="310000"/>
    <emp empno="3" deptno="20" ename="Jill" salary="100001"/>
    </emps>');
    insert into xmltest values(2,
    '<?xml version="1.0"?>
    <emps xmlns="http://emp.com">
    <emp empno="1" deptno="10" ename="John" salary="21000"/>
    <emp empno="2" deptno="10" ename="Jack" salary="310000"/>
    <emp empno="3" deptno="20" ename="Jill" salary="100001"/>
    </emps>');
    commit;
    SELECT a.*
    FROM xmltest,
    XMLTABLE (
    'for $i in /emps/emp
    return $i'
    PASSING xml
    COLUMNS empno NUMBER (2) PATH '@empno',
    deptno NUMBER (3) PATH '@deptno',
    ename VARCHAR2 (10) PATH '@ename',
    salary NUMBER (10) PATH '@salary') a
    WHERE id = 1;
    The above query returning results but below query is not returning any results because of xmlns attribute.
    SELECT a.*
    FROM xmltest,
    XMLTABLE (
    'for $i in /emps/emp
    return $i'
    PASSING xml
    COLUMNS empno NUMBER (2) PATH '@empno',
    deptno NUMBER (3) PATH '@deptno',
    ename VARCHAR2 (10) PATH '@ename',
    salary NUMBER (10) PATH '@salary') a
    WHERE id = 1;
    how to get rid out of this problem.
    Thanks,
    -Mani

    Added below one in xmltable, its working now.
    XmlNamespaces(DEFAULT 'http://emp.com')

  • Xml:version error

    I've stored a very simply stylesheet in to our database using the xmldoc.save() function which produces a stylesheet in the database that looks like this:
    <?xml version = '1.0' encoding = 'ASCII'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://wwww.w3.org/1999/XSL/Transform">
    <!-- This is a blank stylesheet -->
    </xsl:stylesheet>
    When I try to access the stylesheet in my PL/SQL package using the xslt.stylesheet() function I get keep getting the error message:
    ORA-20100: Error occurred while processing: XSL-1009: Attribute 'xsl:version' not found in 'xsl:stylesheet'.
    I've tried several different things but I can get by this error, can anyone help?
    Thanks.
    null

    Hi
    If I change my document header from <?xml version="1.0" encoding="UTF-8"?> to <?xml version="1.0"?> then it parses without error. Will this situation change if I intall ORACLE_HOME? If so, why do I need to install ORACLE_HOME to get the XML Parser to work?
    Thanks.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by xmlteam ([email protected]):
    Hi,
    Do you have your ORACLE_HOME set up correctly?
    Thanks,
    Oracle XML Team<HR></BLOCKQUOTE>

  • Help with registering multiple XML versions with Oracle 9i

    Hello,
    I have a fundamental question. Probably someone had been in similar situation and thought of the best way to handle.
    Our product has about 15 versions that we need to support.
    Each version publishes its 'xmlschema' and is slightly different from the previous version.
    Now if I register each schema version with oracle9i it will auto-create tables for each version (even for xml elements/attributes that are same across different versions).
    2 options that we thought of so far to handle this is
    -Combine all 15 versions schema's into 1 super-set schema and register with oracle db. Fields/elements, a version does not use will be empty
    -Use XML 'extensions' in various xml schema, such that each version in 'extended' from the previous one and keeps on adding its additions attributes/elements. My question is then if I register these 15 'extended' schemas with oracle, will it create common DB tables per version or it will still create unique tables for all 15 versions.
    Anyone has any better suggestions or comments to handle this situation ?
    thanx
    -Manu

    But I'm still stuck on the problem. It still doesn't read the second object. There is no second object.
    The code is quite big, any specific portion would be helpful, please let me know?This is a minimal load and print for an XML bean:import java.io.*;
    import java.beans.*;
    import java.util.*;
    public class LoadAndPrintXMLBean {
      // run with your file name as first argument
      public static void main (String[] args) {
        try {
          XMLDecoder d = new XMLDecoder(
            new BufferedInputStream(
              new FileInputStream(args[0])));
          Object result = d.readObject();
          d.close();
          System.out.println(result);
        } catch (Exception ex) {
          ex.printStackTrace();
    }For your input, it prints[[INDEX_KEY], [7]]You have one object, a vector, containing two vectors:
      The first child vector contains the string "INDEX_KEY".
      The second child vector contains the string "7".
    This matches the structure of your XML<?xml version="1.0" encoding="UTF-8"?>
    <java version="1.4.1_01" class="java.beans.XMLDecoder">
      <object class="java.util.Vector">
        <void method="add">
          <object class="java.util.Vector">
            <void method="add">
              <string>INDEX_KEY</string>
            </void>
          </object>
        </void>
        <void method="add">
          <object class="java.util.Vector">
            <void method="add">
              <string>7</string>
            </void>
          </object>
        </void>
      </object>
    </java>There is only one object there to retrieve using readObject().
    Pete

  • XML Version/encoding line not showing up

    After a long process of getting dbms_xmldom to properly work on 9.2.0.6.0 I generated my output and noticed that the following line is now missing. It was showing up when using just xmldom, but I was running into other issues with attributes showing up on unintended tags.
    <?xml version = '1.0' encoding = 'ISO-8859-1'?>Is the tag above generally a required piece? Either way, does anyone have any ideas on how to get it back?
    I put the following test code together that illustrates the issue. If I change to just xmldom and specify the file path I get incorrect "Incident" element but the xml version line shows up.
    declare
       doc dbms_xmldom.DOMDocument;
       main_node dbms_xmldom.DOMNode;
       root_node dbms_xmldom.DOMNode;
       incident_node dbms_xmldom.DOMNode;
       item_node dbms_xmldom.DOMNode;
       root_elmt dbms_xmldom.DOMElement;
       item_elmt dbms_xmldom.DOMElement;
       item_text dbms_xmldom.DOMText;
       v_clob      CLOB := 'a';
       v_xml VARCHAR2(32767);
       output utl_file.file_type;
    begin
       -- get document
       doc := dbms_xmldom.newDOMDocument;
       -- create root element
       main_node := dbms_xmldom.makeNode(doc);
       root_elmt := dbms_xmldom.createElement(doc, 'Incidents');
       dbms_xmldom.setAttribute(root_elmt, 'xmlns','http://www.claimsuite.com');  -- without the :
       dbms_xmldom.setAttribute(root_elmt, 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
       dbms_xmldom.setAttribute(root_elmt, 'xsi:schemaLocation', 'http://www.claimsuite.com ClaimsuiteShellUS.xsd');
       root_node := dbms_xmldom.appendChild(main_node, dbms_xmldom.makeNode(root_elmt));
       for i in 1 .. 2 loop
          item_elmt := dbms_xmldom.createElement(doc, 'Incident');
          incident_node := dbms_xmldom.appendChild(root_node, dbms_xmldom.makeNode(item_elmt));
          --CrawfordHandlingOfficeReference
          item_elmt := dbms_xmldom.createElement(doc, 'HandlingOfficeReference');     
          item_node := dbms_xmldom.appendChild(incident_node, dbms_xmldom.makeNode(item_elmt));
          item_text := dbms_xmldom.createTextNode(doc, 'HandlingOfficeRef');
          item_node := dbms_xmldom.appendChild(item_node, dbms_xmldom.makeNode(item_text));
       end loop;
       -- instead of writing to file, it writes to clob  
       dbms_xmldom.writeToFile(doc, 'IO_DIR_SHL_RSG/test.xml');
       -- free resources
       dbms_xmldom.freeDocument(doc);
    end;Thank you.

    Hi,
    DBMS_XMLDOM.writeToFile has an overloading where you can specify the output character set :
    dbms_xmldom.writeToFile(doc, 'IO_DIR_SHL_RSG/test.xml', 'ISO-8859-1');

  • Passagem do XML version no SCAN.

    Olá Pessoal,
    Eu estou ativando o SCAN na 4.6c e depois de estudar o funcionamento do SCAN estou tentando testar o mesmo. Porém descobri que na versão que eu estou trabalhando aqui no lado R/3 a função J_1B_NFE_CHECK_ACTIVE_SERVER chama a função de checagem do servidor no GRC(/XNFE/RFC_SRVSTA_READ) passando alguns paramêtros. Na estrutura LT_REGIO está passando apenas valor para o campo REGIO e nada para o campo VERSION, sendo assim no lado do GRC existe um código que valida se o VERSION está em branco e se sim ele alimenta esse campo com o valor 005a(versão antiga).
    Existe alguma nota de correção disso, é algo configuravél ou preciso tratar isso pela metodo GET_SERVER na BADI ????
    Eu procurei notas mas não encontrei e creio que o SAP deveria passar o valor 006 no campo VERSION ou no GRC ter uma validação para chegar qual a versão do XML e preencher corretamente caso venha em branco, certo?
    Obrigado,
    Michael Peretto

    Bom dia Michael,
    Trecho de código da nota, ele só não passa quando versão 1.10, se for 2.00 ele seta o 006:
      ls_regio-regio = ls_branch_info-regio.                   "1484983
    * Convert XML version to GRC format                        "1484983
      IF ls_cust3-version >= 2.                                "1484983
       ls_regio-version = '006'.                               "1484983
      ENDIF.                                                   "1484983
      APPEND ls_regio TO lt_regio.
    Abre um chamado para XX-CSC-BR-NFE, provavelmente este trecho está faltando para 4.6c
    Atenciosamente, Fernando Da Ró

  • Dunning Letter XML not displaying XML version of Dunning Letter

    I have changed the Output Format for "Dunning Letter Print from Dunning Letter Generate" to XML. When I run the Dunning Letter Generate process, though, the XML output in the Dunning Letter Print from Dunning Letter Generate does not display the XML of the Dunning Letter. Instead, the following XML is displayed:
    <?xml version="1.0"?>
    <!-- Generated by Oracle Reports version 6.0.8.27.0 -->
    <ARDLP>
    <LIST_G_CORRESPONDENCES>
    </LIST_G_CORRESPONDENCES>
    <R_INTEREST_RATE></R_INTEREST_RATE>
    <R_DEFAULT_COUNTRY>NL</R_DEFAULT_COUNTRY>
    <C_TRX_NUMBER>APP-00001: Unable to find message: AR_REPORTS_TRX_NUMBER</C_TRX_NUMBER>
    <C_PO>APP-00001: Unable to find message: AR_REPORTS_PO</C_PO>
    <C_DEBIT>APP-00001: Unable to find message: AR_REPORTS_DEBIT</C_DEBIT>
    <R_DEFAULT_COUNTRY_DESC>M-3M-WM-4M-zM-6M-uM-5M-e</R_DEFAULT_COUNTRY_DESC>
    </ARDLP>
    Is there any specific setup required to generate the appropriate XML for the Dunning Letter?

    Kit
    It is definitely possible to use XML Publisher for dunning letters. I would suggest your sample run did not select anything for dunning as the XML looks correct otherwise. The problem with this approach is that it is not a single step process to get the letters. You will only ever get XML from the dunning letter print report as there is nowhere in the submission screen to tell it what template to use. Therefore you will need to modify the after report trigger to submit the XML Report Publisher concurrent program to automatically pick up the XML and create the letters.
    You might want to look at the standard functionality in collections or advanced collections (not sure about collections but definitely in advanced) as there is some standard functionality in there for Dunning which uses XML Publisher templates. The setup is a bit onerous (not sure what the developers were thinking) but at least you can use XMLP as standard.
    Cheers,
    Dave

  • Of the version attribute of a HelpSet tag

    Okay, I admit to being somewhat stumped here.
    Is there any way to access the value of the version attribute of the helpset element (or indeed, any of the version attributes of any of the various index, content & map files)?
    I'm trying to version an app's help content, and while these version attributes seem ready made for my purposes, without any way to access them from w/in the JH API, they're effectively useless (I don't want to have to resolve the known location of the .hs or .jhm file(s) just to parse them and get the version attribute(s) value(s) if possible, and I don't want to explore viable alternate versioning methods until I know why this one won't work).
    I'm having a really hard time understanding why this attrib. isn't/wasn't exposed. Maybe I'm just having a brainblock in seeing where/how it's exposed.
    All thoughts, comments, suggestions and questions are entertained, if not outright entertaining. Thanks in advance,
    -dSn

    See what happens when ya don't read the spec's backing the API's ya use? I haven't read that spec in over 2 years, and apparently it didn't jump out at me at that time as importand and/or major. Guess it all depends on what you're looking for when you read something.
    Thanks for the quick help; I'm off to implement my own personal version...erm...vision of versioning...um...anyway, back to it.
    Thanks again!
    -dSn

  • Why ' ?xml version="1.0" encoding="UTF-8"? ' is not appearing in XML ( 9.2)

    Hi,
    I am using following SQL query to generate output from XML
    select
    XMLTYPE
    ('<?xml version="1.0" encoding="UTF-8"?>'||
    xmlelement("bank",
    XMLATTRIBUTES('http://www.w3.org/2001/XMLSchema' AS "xmlns:xsi",
    'http://www.XXXX.xsd' AS "xsi:nonamespaceSchemaLocation" ),
    xmlelement("Transaction",
    xmlforest(
    intraday "MessageCode",
    actnum "ToAccountNo",
    v00090 "ToBranchCode",
    v00230 "CurrencyCode",
    amt "Amount",
    trandt "TransactionDate",
    valuedt "ValueDate"),
    xmlelement("CustomerRefNo",
    xmlforest(
    utr_number "ReferenceNo1",
    ref1 "ReferenceNo2",
    ref2 "Custtype",
    r1 "SequenceNo"
    x1
    from
    It is working fine but '<?xml version="1.0" encoding="UTF-8"?>' it is not coming as header of output My output is coming like
    <bank xmlns:xsi="http://www.w3.org/2001/XMLSchema" xsi:nonamespaceSchemaLocation="http://www.XXXX.xsd">
    <Transaction>
    <MessageCode>0100</MessageCode>
    <ToAccountNo>012340123456</ToAccountNo>
    <ToBranchCode>01234</ToBranchCode>
    <CurrencyCode>INR</CurrencyCode>
    <Amount>11.00</Amount>
    <TransactionDate>2007-01-15T17:54:31</TransactionDate>
    <ValueDate>2007-01-15</ValueDate>
    Kindly help.
    PJP

    Try using the XMLRoot function.
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb13gen.htm#sthref1566

Maybe you are looking for

  • Unable to send email POP3 email from Outlook 2013 unless signed on as local admin

    Windows 7 Outlook 2013 I recently upgraded from Office 2010 to 2013.  For several weeks everything ran smoothly but a few days ago I noticed that my Verizon POP3 account was unable to send mail - items just sit in outbox.  I have deleted/added the ac

  • In UDF text paste.

    Dear All, I have an requirement in which I have made a UDF( type is alphanumeric and structure is text ) in the marketing document for Sales Quotation. Now the user will copy some text from an external document and would paste in this udf. The text f

  • Full Optimize Error - OutOfMemmory in SAP BPC

    Hello Has anyone come across the following error when running a full Optimize from SAP BPC Administration. Error Message: Exception of type system OutOfMemoryException was thrown. I've raised a support call but would appreciate any help on knowing wh

  • Keyboard Short Cut Question

    So, I am a new Mac user. Everything is great...except... I use Thunderbird for my email. I go through a lot of emails and like to keep them in their appropriate folders. In windows, all I had to do to move an email to its folder was, right click, the

  • Delivery split reason after delivery creation

    Hi All, We have an issue with an outbound delivery. There are 5 materials in the Sales order and have common Item category, Plant, Shipping point, Delivery date and Route. But somehow 5 different deliveries created by a batch job. I need to find out