XSLT with namespaces/schema

Hi everybody !
I've a problem transforming a XML file that has a root element containing a reference to a XSD schema.
<myxml xmlns="http://www.myxml.de" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.myxml.de myxml.xsd">
The XSLProcessor does not accept the attribute in the root element but always complains that to be empty :-((.
I was told, that one of the few processors that could handle Schema and namespaces was the Oracle v2 lib.
So I'm trying to transform with the following piece of code and ORACLE v2 parser lib:
import java.io.*;
import javax.xml.transform.*;
import javax.xml.transform.stream.*;
public class SimpleTrAX
public static void main( String[] args )
try
File xslIn = new File( "D:/A.xslt" );
File xmlIn = new File( "D:/B.xml" );
File xmlOut = new File( "D:/C.xml" );
// System.setProperty( "javax.xml.parsers.DocumentBuilderFactory", "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
// System.setProperty( "javax.xml.parsers.DocumentBuilderFactory", "org.apache.crimson.jaxp.DocumentBuilderFactoryImpl");
// System.setProperty( "javax.xml.parsers.SAXParserFactory", "org.apache.xerces.jaxp.SAXParserFactoryImpl");
// System.setProperty( "javax.xml.parsers.SAXParserFactory", "org.apache.crimson.jaxp.SAXParserFactoryImpl");
// System.setProperty( "javax.xml.transform.TransformerFactory", "org.apache.xalan.processor.TransformerFactoryImpl");
xmlOut.createNewFile();
TransformerFactory transFact = TransformerFactory.newInstance();
StreamSource xslStream = new StreamSource( xslIn );
StreamSource xmlStream = new StreamSource( xmlIn );
FileOutputStream fileOut = new FileOutputStream( xmlOut );
StreamResult xmlResult = new StreamResult( fileOut );
Transformer trans = transFact.newTransformer( xslStream );
trans.transform( xmlStream, xmlResult );
catch (Exception e) { System.out.println( e ); }
I haven't found any attributes or properties to set the transformer or it's factory to be namespace aware. Any help or helpful hint will be highly appreciated ! Thanks in advance !
Best regards
Juergen

Thanks for your quick answer !
But including the namespace which is part of the root element in file A into the transforming stylesheet (as you proposed) that should produce result file C seems to
mislead the transformer:
It now validates the root tags of the transformation script against the wrong namespace/schema:
<xsl:stylesheet version="1.0"
xmlns="http://www.myxml.de"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.myxml.de myxml.xsd"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="myxml"> <!-- Match root of source doc A -->
<root_of_result_document_C>
<!-- apply something else -->
</root_of_result_document_C>
</xsl:template>
</xsl:stylesheet>
I now get an error (comprehensible for me):
"Root element 'root_of_result_document_C' not defined in DTD/Schema"
???

Similar Messages

  • XSLT with namespaces

    Hello everyone:
    I am using the xalan-j_2_2_D9 from apache to design my style sheets. I was going through the examples that come along with the package and tried out the simple transform program for a style sheet and a corresponding xml file.
    It was strange really, when I apply the stylesheet to an xml file which has no namespaces...it works fine...bbut if there is a namespace there I get nothing.
    Is there any specific approach to be used in xslt if the xml record has namespaces
    Thanks
    Prashanth

    some code to support what I said above.....
    say I have the xml file....
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="sample1.xsl"?>
    <CATALOG xmlns="http://www.xyz.com/schema" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xmlns:abc="http://www.xyz.com/schema" xsi:schemaLocation="http://www.xyz.com/xsd/metadatav1p1 xyz_rootv1p1.xsd">
         <CD>
              <abc:TITLE>Empire Burlesque</abc:TITLE>
              <ARTIST>Bob Dylan</ARTIST>
              <COUNTRY>USA</COUNTRY>
              <abc:COMPANY>Columbia</abc:COMPANY>
              <PRICE>10.90</PRICE>
              <YEAR>1985</YEAR>
         </CD>
    </CATALOG>
    and my stylesheet reads as follows....
    <?xml version='1.0'?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="/">
    <html>
    <body>
    <xsl:for-each select="CATALOG">
    <xsl:value-of select="CD/ARTIST"/>
    </xsl:for-each>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    I use the XALAN's simpletransform program
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerConfigurationException;
    // Imported java classes
    import java.io.FileOutputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    * Use the TraX interface to perform a transformation in the simplest manner possible
    * (3 statements).
    public class SimpleTransform
         public static void main(String[] args)
    throws TransformerException, TransformerConfigurationException,
    FileNotFoundException, IOException
    // Use the static TransformerFactory.newInstance() method to instantiate
    // a TransformerFactory. The javax.xml.transform.TransformerFactory
    // system property setting determines the actual class to instantiate --
    // org.apache.xalan.transformer.TransformerImpl.
         TransformerFactory tFactory = TransformerFactory.newInstance();
         // Use the TransformerFactory to instantiate a Transformer that will work with
         // the stylesheet you specify. This method call also processes the stylesheet
    // into a compiled Templates object.
         Transformer transformer = tFactory.newTransformer(new StreamSource("xmlToHTML.xsl"/*Stylesheet*/));
         // Use the Transformer to apply the associated Templates object to an XML document
         // (foo.xml) and write the output to a file (foo.out).
         transformer.transform(new StreamSource("sample.xml"/*XML File*/), new StreamResult(new FileOutputStream("birds1.htm/*Output File*/")));
         System.out.println("************* The result is in birds1.htm *************");
    CODE COURTESY: Apache
    I get no output in my birds1.htm file except the html and body tags.!
    Can anybody please help me out with this
    Thanks a lot in advance
    Prashanth

  • Using XSLT to extract value of a XML node with namespace

    I have a XML source code here.
    <?xml version="1.0" encoding="utf-8" ?>
    <rss version="2.0" xmlns:job="http://www.pageuppeople.com">
      <channel>
        <title>SMH Jobs</title>
        <link>internalrecruitment.smhgroup.com.au/jobsrss.ashx?stp=di</link>
        <description>A listing of jobs available here</description>
        <item>
          <title>eCommerce Optimisation Advisor</title>
          <description>A new and exciting opportunity exists for an experienced eCommerce Advisor to join</description>
          <job:location PUReferenceID="3711">Sydney - Inner Suburbs & CBD</job:location>
        </item>
      </channel>
    </rss>
    I want to use XSLT to extract value of a XML node with namespace <job:location>, and the returned value should be string 'Sydney - Inner Suburbs & CBD'. I tried a few XSL code below, but failed with error or nothing was returned.
    <xsl:value-of select="job:location" disable-output-escaping="yes"/>
    <xsl:value-of select="job/location" disable-output-escaping="yes"/>
    <xsl:value-of select="job\location" disable-output-escaping="yes"/>
    <xsl:value-of select="location" disable-output-escaping="yes"/>
    This might be an easy question for you, but I would appreciate if anyone can help.

    Hi Suncorp IT Learner,
    We need to tell the XSLT that some elements are in another namespace. Copy the xmls declarations for the prefixes you need to use. Then use the xsl format as:
    <xsl: value-of select=”job:location/@PUReferenceID”/>
    In following issue, Chriztian has a good explanation:
    http://our.umbraco.org/forum/developers/xslt/33353-XSLT-reading-XML-attribute-value
    Thanks,
    Qiao Wei
    TechNet Community Support

  • I am facing a new problem with xml schema, plz help me

    Hi @,
    I am facing a problem with xml schema validation. Below is my code.
    public void initialize(String cfgFileName) {
    try {
    try {
    DOMParserWrapper parser = (DOMParserWrapper)Class.forName("dom.wrappers.DOMParser").newInstance();
    parser.setFeature( "http://apache.org/xml/features/dom/defer-node-expansion",true );
    parser.setFeature( "http://xml.org/sax/features/validation",true);
    parser.setFeature( "http://xml.org/sax/features/namespaces",true );
    parser.setFeature( "http://apache.org/xml/features/validation/schema",true );
    parser.setFeature( "http://apache.org/xml/features/validation/schema-full-checking",true );
    Document document = parser.parse(cfgFileName);
    System.out.println("Vijay .. code .. damar\n");
    }catch (org.xml.sax.SAXParseException spe) {
    } catch (org.xml.sax.SAXNotRecognizedException ex ){
    } catch (org.xml.sax.SAXNotSupportedException ex ){
    } catch (org.xml.sax.SAXException se) {
    if (se.getException() != null)
    se.getException().printStackTrace(System.err);
    else
    se.printStackTrace(System.err);
    }catch (Exception e) {
    System.out.println("Caught unknown exception : \n");
    e.printStackTrace(System.err);
    System.out.println("Vijay .. code .. success\n");
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    //docBuilder.setErrorHandler(myErrorHandler);
    cfg = docBuilder.parse(new File(cfgFileName));
    cfg .getDocumentElement ().normalize ();
    } catch (Exception e) {
    e.printStackTrace();
    In the above code I am parsing the xml file and i am doing schema validation. Schema validation is proper and it is validating correctly. Only problem is that, It is validating and showing error correctly correctly but it is not catching that error.
    For clear understanding I am printing one statement before parsing and after parsing.
    SYSTEM.OUT.PRINTLN("Vijay .. code .. damar\n") this is before parsing
    SYSTEM.OUT.PRINTLN("Vijay .. code .. success\n") this is after parsing
    Here what is happening means, It is validating correctly and showing error :
    [Error] nw_layout-new.xml:800:97: Datatype error: Value 'y' does not match regular expression facet 'yes|no'..
    Vijay .. code .. damar
    Vijay .. code .. success
    Here it is showing error and still continueing not catching.
    Plz give solution for this.
    Thanks
    vijay K

    Hello dipthebe,
    Check out the articles below go through troubleshooting steps for your iPhone when the screen is unresponsive. You may want to try and restore your iPhone as a new device and then test out what happens when you miss a call to see if the issue is still present afterwards.
    iPhone, iPad, iPod touch: Troubleshooting touchscreen response
    http://support.apple.com/kb/ts1827
    Use iTunes to restore your iOS device to factory settings
    http://support.apple.com/kb/HT1414
    Regards,
    -Norm G.

  • Why XPath didnot work with Namespace ?

    Dear all,
    When I parsing a xml document with Namespace by XPath , it didnot work well , but if I remove the part of Namespace , it worked well , I am not sure if I processed with right steps , any help is appreciated :
    My parser : jdom-b9
    jdk : 1.4.1
    My code is like :
    import java.io.*;
    import java.util.*;
    import org.jdom.*;
    import org.jdom.input.*;
    import org.jdom.output.*;
    import org.jdom.xpath.*;
    public class XPathTest {   
        public static void main(String[] args) throws IOException, JDOMException {
            if (args.length != 1) {
                System.err.println("Usage: samples.XPathTest [test.xml]");
                return;
            String filename = args[0];
            PrintStream out = System.out;
            SAXBuilder builder = new SAXBuilder();
            Document doc = builder.build(new File(filename));
            Element root = doc.getRootElement();          
            XPath path = XPath.newInstance("//Worksheet");          
            path.addNamespace("ss","urn:schemas-microsoft-com:office:spreadsheet");
            // or use :
            //Namespace ns = root.getNamespace();
            //path.addNamespace(ns);
            List elementNames = path.selectNodes(doc);
            if (elementNames.size() == 0) {
                out.println("This xml contains no element <Worksheet>");
            } else {
                out.println("This xml contains " + elementNames.size() + " <Worksheet> :");
                Iterator i = elementNames.iterator();
                while (i.hasNext()) {
                    out.println("\t" + ((Element)i.next()).getName());
    }and test.xml :
    <?xml version="1.0"?>
    <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
    xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:x="urn:schemas-microsoft-com:office:excel"
    xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
    xmlns:html="http://www.w3.org/TR/REC-html40">
    <Worksheet ss:Name="Sheet2">
      <Table ss:ExpandedColumnCount="12" ss:ExpandedRowCount="38" x:FullColumns="1"
       x:FullRows="1" ss:DefaultColumnWidth="54" ss:DefaultRowHeight="14.25">
       <Column ss:Width="63"/>
       <Column ss:Width="76.5"/>
       <Column ss:Width="103.5"/>
       <Column ss:Width="123"/>
       <Column ss:Width="136.5"/>
       <Column ss:Width="83.25"/>
       <Column ss:Width="39"/>
       <Column ss:Width="76.5"/>
       <Column ss:Width="103.5"/>
       <Column ss:Width="90"/>
       <Column ss:Width="76.5"/>
       <Column ss:Width="90"/>
       <Row>
        <Cell><Data ss:Type="String">PORT_CODE</Data></Cell>
        <Cell><Data ss:Type="String">EFFECT_DATE</Data></Cell>
        <Cell><Data ss:Type="String">END_DATE</Data></Cell>
        <Cell><Data ss:Type="String">ENCODE_SCHEME_PORT</Data></Cell>
        <Cell><Data ss:Type="String">PORT_NAME</Data></Cell>
        <Cell><Data ss:Type="String">COUNTRY_CODE</Data></Cell>
        <Cell><Data ss:Type="String">IS_RT</Data></Cell>
        <Cell><Data ss:Type="String">DATA_SOURCE</Data></Cell>
        <Cell><Data ss:Type="String">LAST_UPD_DATE</Data></Cell>
        <Cell><Data ss:Type="String">LAST_UPD_USER</Data></Cell>
        <Cell><Data ss:Type="String">BP_UPD_DATE</Data></Cell>
        <Cell><Data ss:Type="String">PROVINCE_CODE</Data></Cell>
       </Row>
      </Table>
    </Worksheet>
    </Workbook>test1.xml
    <?xml version="1.0"?>
    <Workbook>
    <Worksheet Name="Sheet2">
      <Table>
       <Column Width="63"/>
       <Column Width="76.5"/>
       <Column Width="103.5"/>
       <Column Width="123"/>
       <Column Width="136.5"/>
       <Column Width="83.25"/>
       <Column Width="39"/>
       <Column Width="76.5"/>
       <Column Width="103.5"/>
       <Column Width="90"/>
       <Column Width="76.5"/>
       <Column Width="90"/>
       <Row>
        <Cell><Data Type="String">PORT_CODE</Data></Cell>
        <Cell><Data Type="String">EFFECT_DATE</Data></Cell>
        <Cell><Data Type="String">END_DATE</Data></Cell>
        <Cell><Data Type="String">ENCODE_SCHEME_PORT</Data></Cell>
        <Cell><Data Type="String">PORT_NAME</Data></Cell>
        <Cell><Data Type="String">COUNTRY_CODE</Data></Cell>
        <Cell><Data Type="String">IS_RT</Data></Cell>
        <Cell><Data Type="String">DATA_SOURCE</Data></Cell>
        <Cell><Data Type="String">LAST_UPD_DATE</Data></Cell>
        <Cell><Data Type="String">LAST_UPD_USER</Data></Cell>
        <Cell><Data Type="String">BP_UPD_DATE</Data></Cell>
        <Cell><Data Type="String">PROVINCE_CODE</Data></Cell>
       </Row>
      </Table>
    </Worksheet>
    </Workbook>The output of test.xml is : This xml contains no element <Worksheet>
    The output of test1.xml with no namespace part is :
    This xml contains 1 <Worksheet> :
    Worksheet
    WHY ????????????????????????????

    I do not use jdom but I had similar problems. You can try "//:worksheet". The prefix for the default namespace might be "". it fixed my problem.
    wz

  • Generate Adobe Interactive Form with XML Schema-Based Interface

    Hi,
    I need to generate a adobe Interactive but with XML Schema-Based Interface, i have one example but with ABAP Dictionary-Based Interface.
    CALL FUNCTION 'FP_JOB_OPEN'
      CHANGING
        ie_outputparams       = fp_outputparams
    * EXCEPTIONS
    *   CANCEL                = 1
    *   USAGE_ERROR           = 2
    *   SYSTEM_ERROR          = 3
    *   INTERNAL_ERROR        = 4
    *   OTHERS                = 5
    CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
      EXPORTING
        i_name     = 'ZMMDM_CL'
      IMPORTING
        e_funcname = fm_name.
    But when i call the next function for print i need the docxml parameter and i don't know how to get it
    fm_name
    CALL FUNCTION fm_name
      EXPORTING
       /1BCDWB/DOCPARAMS        = fp_docparams
    *    /1bcdwb/docxml           =
    * IMPORTING
    *   /1BCDWB/FORMOUTPUT       =
    * EXCEPTIONS
    *   USAGE_ERROR              = 1
    *   SYSTEM_ERROR             = 2
    *   INTERNAL_ERROR           = 3
    *   OTHERS                   = 4

    1) this questions was asked many times before, you didn´t search for a second
    2) I am not aware of any standard solution
    3) custom solution: use XSLT transformation ID to get XML from the filled DDIC structure and use string operations to add the header and footer to create a valid XML.
    Regards Otto

  • Validating with multiple schemas

    I am setting the schama attribute as follow:
    String schemaSource = "C:\\Documents and Settings\\ayache\\My Documents\\C5 XML\\schema\\searhRequest.xsd";
                   String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
                   builderFactory.setAttribute(JAXP_SCHEMA_SOURCE, new File(schemaSource));searchRequest.xsd contains include statement: it referes to another schema. When i try to validate the xml document using the scheam above error is thrown stating that the elements that are defined in the second schema(BookingProfile.xsd) are not recognised or can't be resolved.
    Is there a way to set multiple schemas?
    Your help is much appreciated.

    I figured out my problem in case anyone else is having trouble..
    In the xml document that you need to refer to:
    xmlns:xsd="http://www.w3.org/2000/10/XMLSchema-instance that is the namespace
    supported by xerces 1.3.1.
    Whew!
    "Karen Schaper" <[email protected]> wrote:
    >
    Has anyone been successful at validating xml with a Schema running weblogic
    6.1
    sp2?
    Here is a snippet of code...
    SAXParserFactory objFactory = SAXParserFactory.newInstance();
    objFactory.setValidating("true");
    objFactory.setNamespaceAware("true");
    objFactory.setFeature("http://apache.org/xml/features/validation/schema",
    "true");
    objXMLInputParser.parse(new InputSource(new StringReader(XMLDocument)),
    A_HANDLER);
    When my xml code runs through the parser I get an error for each element
    saying
    the element type is not declared in the dtd or schema.
    Since weblogic 6.1 runs with 1.3.1 Xerces parser. Does it support xml
    validation
    with a Schema. From what I've read it seems that it does.
    Any help or insight would be appreciated.
    Thanks
    Karen

  • Unexpected start node "Insert" with namespace...

    Hi,
           I have a simple Biztalk app which receives an XML and sends to oracle DB using WCF-custom adapter.
    I generated schema from Visual Studio, created a map for inbound XSD to generated XSD mapping, deployed the app.
    Send port is configured to use the map and there is no orchestration.
    I run into following error. The error description is understood, but I am not able to see why it is happening.
    The adapter failed to transmit message going to send port "SendPort12" with URL "oracledb://DEVDB/". It will be retransmitted after the retry interval specified for this Send Port. Details:"Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: Unexpected start node "Insert" with namespace "http://Microsoft.LobServices.OracleDB/2007/03/DEVSCHEMA/Table/SITES" found.
    SOAP Action is :
    <BtsActionMapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Operation Name="Insert" Action="http://Microsoft.LobServices.OracleDB/2007/03/DEVSCHEMA/Table/SITES/Insert" />
    </BtsActionMapping>
    I have checked multiple posts on different sites for this error. I am still not able to figure out what is causing this. Any help is appreciated.
    Thanks,
    SRG

    Hi SRG,
    Can you try generating schema again as may be some table change may have occurred . It may be silly but you can try 
    There are tow different post which can relate to your issue and resolution
    https://social.msdn.microsoft.com/Forums/en-US/c9e15c82-3bec-4bbb-b3c2-2507206c2d40/microsoftservicemodelchannelscommonxmlreaderparsingexception-unexpected-start-node?forum=biztalkr2adapters 
    https://social.msdn.microsoft.com/Forums/en-US/59ef69e7-3159-4fd6-ba67-9120d907f95e/wcforacledb-unexpected-start-node-node-with-namespace?forum=biztalkr2adapters
    Thanks
    Abhishek

  • How to extract  XML with namespace?

    Hi all,
    Below is the XML i have :
    <?xml version="1.0" encoding="UTF-8" ?>
    - <Transaction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.test.com/Support/Services/test1/2012" xsi:schemaLocation="http://schemas.test.com/Support/Services/test1/2012 Support.test1.v1.xsd">
    - <Request>
    <Memid>10</Memid>
    <Actid>32</Actid>
    <Pax>3</Pax>
    <Flt>2012-DEC-10</Flt>
    <Username>WebUserNameTest</Username>
    </Request>
    <Request>
    <Memid>1</Memid>
    <Actid>3</Actid>
    <Pax>2</Pax>
    <Flt>2012-DEC-12</Flt>
    <Username>WebUserNameTest</Username>
    </Request>
    </Transaction>
    I want to extract the element values :
    The below code will help me when i have no namespace , what must be done in order to work with namespace and etract element value
    v_string_xml :=
    ' //Request[' || TO_CHAR (counter_xml) || ']/Memid/text()';
    v_ssp_table (v_ssp_table.COUNT).memid :=
    p_xml_in.EXTRACT (v_string_xml).getnumberval ();
    v_string_xml :=
    '//Request[' || TO_CHAR (counter_xml) || ']/Actid/text()';
    v_ssp_table (v_ssp_table.COUNT).actid :=
    p_xml_in.EXTRACT (v_string_xml).getnumberval ();
    v_string_xml :=
    '//Request['
    || TO_CHAR (counter_xml)
    || ']/Pax/text()';
    v_ssp_table (v_ssp_table.COUNT).pax :=
    p_xml_in.EXTRACT (v_string_xml).getnumberval ();
    v_string_xml :=
    '//Request[' || TO_CHAR (counter_xml) || ']/Flt/text()';
    v_ssp_table (v_ssp_table.COUNT).flt :=
    p_xml_in.EXTRACT (v_string_xml).getstringval ();
    v_string_xml :=
    '//Request['
    || TO_CHAR (counter_xml)
    || ']/Username/text()';
    v_ssp_table (v_ssp_table.COUNT).username :=
    p_xml_in.EXTRACT (v_string_xml).getstringval ();

    declare
      v_xml xmltype := xmltype( '<?xml version="1.0" encoding="UTF-8" ?>
    <Transaction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.test.com/Support/Services/test1/2012" xsi:schemaLocation="http://schemas.test.com/Support/Services/test1/2012 Support.test1.v1.xsd">
    <Request>
    <Memid>10</Memid>
    <Actid>32</Actid>
    <Pax>3</Pax>
    <Flt>2012-DEC-10</Flt>
    <Username>WebUserNameTest</Username>
    </Request>
    <Request>
    <Memid>1</Memid>
    <Actid>3</Actid>
    <Pax>2</Pax>
    <Flt>2012-DEC-12</Flt>
    <Username>WebUserNameTest</Username>
    </Request>
    </Transaction>' );
    begin
      for r_xml in ( select *
                     from xmltable( xmlnamespaces( default 'http://schemas.test.com/Support/Services/test1/2012' )
                                   , '/Transaction/Request'
                                   passing v_xml
                                     columns memid number path 'Memid'
                                           , actid number path 'Actid'
                                           , pax number path 'Pax'
                                           , flt varchar2(100) path 'Flt'
                                           , username varchar2(100) path 'Username'
      loop
        dbms_output.put_line( r_xml.memid );
        dbms_output.put_line( r_xml.actid );
        dbms_output.put_line( r_xml.pax );
        dbms_output.put_line( r_xml.flt );
        dbms_output.put_line( r_xml.username );
      end loop;
    end;

  • Validating with XML Schemas

    Has anyone been successful at validating xml with a Schema running weblogic 6.1
    sp2?
    Here is a snippet of code...
    SAXParserFactory objFactory = SAXParserFactory.newInstance();
    objFactory.setValidating("true");
    objFactory.setNamespaceAware("true");
    objFactory.setFeature("http://apache.org/xml/features/validation/schema", "true");
    objXMLInputParser.parse(new InputSource(new StringReader(XMLDocument)), A_HANDLER);
    When my xml code runs through the parser I get an error for each element saying
    the element type is not declared in the dtd or schema.
    Since weblogic 6.1 runs with 1.3.1 Xerces parser. Does it support xml validation
    with a Schema. From what I've read it seems that it does.
    Any help or insight would be appreciated.
    Thanks
    Karen

    I figured out my problem in case anyone else is having trouble..
    In the xml document that you need to refer to:
    xmlns:xsd="http://www.w3.org/2000/10/XMLSchema-instance that is the namespace
    supported by xerces 1.3.1.
    Whew!
    "Karen Schaper" <[email protected]> wrote:
    >
    Has anyone been successful at validating xml with a Schema running weblogic
    6.1
    sp2?
    Here is a snippet of code...
    SAXParserFactory objFactory = SAXParserFactory.newInstance();
    objFactory.setValidating("true");
    objFactory.setNamespaceAware("true");
    objFactory.setFeature("http://apache.org/xml/features/validation/schema",
    "true");
    objXMLInputParser.parse(new InputSource(new StringReader(XMLDocument)),
    A_HANDLER);
    When my xml code runs through the parser I get an error for each element
    saying
    the element type is not declared in the dtd or schema.
    Since weblogic 6.1 runs with 1.3.1 Xerces parser. Does it support xml
    validation
    with a Schema. From what I've read it seems that it does.
    Any help or insight would be appreciated.
    Thanks
    Karen

  • WS-I validation failes with imported schema

    I'm getting the following error from the WS-I validation checker (Basic Profile 1.1):
    faultCode=INVALID_WSDL: Unable to determine namespace of 'messages:SigReplyMessage'.:
    Any idea what I'm doing wrong?
    My wsdl file looks like this:
    <definitions targetNamespace="urn:S3SignatureGenerator"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="urn:S3SignatureGenerator"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
    <types>
    <xsd:schema>
    <xsd:import id="Messages.xsd"
    schemaLocation="../../XSDDocument/Messages.xsd"
    namespace="messages"/>
    </xsd:schema>
    </types>
    <message name="ReturnSignature">
    <part name="SigAndExp" type="messages:SigReplyMessage"/>
    </message>
    <message name="RequestSignature">
    <part name="Keys" type="messages:SigRequestMessage"/>
    </message>
    <portType name="SigGenerator">
    <operation name="GetSignature">
    <input message="tns:RequestSignature"/>
    <output message="tns:ReturnSignature"/>
    <fault name="sigFault" message="tns:SigFault"/>
    </operation>
    </portType>
    <message name="SigFault">
    <part name="faultMessage" element="string"/>
    </message>
    <binding name="SigGenSoapHttp" type="tns:SigGenerator">
    <soap:binding style="document"
    transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="GetSignature">
    <soap:operation soapAction="urn:S3SignatureGenerator/GetSignature"/>
    <input>
    <soap:body use="literal" parts="SecretKey PublicKey"/>
    </input>
    <output>
    <soap:body use="literal" parts="Signature"/>
    </output>
    <fault name="sigFault">
    <soap:body use="literal" parts="SecretKey PublicKey"/>
    </fault>
    </operation>
    </binding>
    <service name="SignatureGenerationService">
    <port name="SigGenSoapHttpPort" binding="tns:SigGenSoapHttp">
    <soap:address location="tbd"/>
    </port>
    </service>
    </definitions>
    Messages.xsd looks like this:
    <?xml version="1.0" encoding="windows-1252" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.example.org"
    targetNamespace="http://www.example.org"
    elementFormDefault="qualified">
    <xsd:complexType name="sigRequestMessage">
    <xsd:sequence>
    <xsd:element name="publicKey" type="string"/>
    <xsd:element name="privateKey" type="string"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="complexType1">
    <xsd:sequence>
    <xsd:element name="Signature" type="string"/>
    <xsd:element name="expiration" type="timeDate"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>

    You need to distinguish between the namespace and the namespace prefix.
    Your WSDL imports Messages.xsd with namespace "messages",
    but the schema defines namespace "http://www.example.org".
    You should change the import to use the right namespace,
    then declare the messages prefix in your WSDL:
    <definitions ....
    xmlns:messages="http://www.example.org" >
    <xsd:import id="Messages.xsd"
    schemaLocation="../../XSDDocument/Messages.xsd"
    namespace="http://www.example.org"/>
    Mik

  • Unstructured Xml Storage with Namespaces - Problem in DML Queries

    Hai All,
    I worked with xml namespace with registering schema in db and referred in my xml document.It worked fine.
    But i want to work in unstructured xml document with namespaces, to do all dml queries like, select,update,delete using Xpath to xmltype.
    I could insert the records,When i try to select some element from xmltype field using Xptah from db,it does not bring any thing like element value or any error.It just displaying as empty value.I am using oracle 10g R2.
    Please help me how to select the element value from xmltype using XPath or whatever it is.
    Please help me out from this to follow
    Advance Thanks,
    P.Savananan

    SQL> create user marco identified by marco account unlock;
    User created.
    SQL> grant dba, xdbadmin to marco;
    Grant succeeded.
    SQL> conn marco/[email protected]
    Connected.
    SQL> create table xml_tab ( details xmltype);
    Table created.
    SQL> insert into xml_tab values(XMLTYPE('<?xml version="1.0" ?>
      2  <customers xmlns="http://localhost/openuri.org" >
      3  <customer>
      4  <order xmlns="http://orcl.com" >
      5  <ordername>Computer</ordername>
      6  <cost>35785638</cost>
      7  </order>
      8  </customer>
      9  </customers>'));
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select extractValue(details,'/customers/customer/order/ordername') from xml_tab;
    EXTRACTVALUE(DETAILS,'/CUSTOMERS/CUSTOMER/ORDER/ORDERNAME')
    SQL> set long 10000
    SQL> select * from xml_tab;
    DETAILS
    <?xml version="1.0"?>
    <customers xmlns="http://localhost/openuri.org">
      <customer>
        <order xmlns="http://orcl.com">
          <ordername>Computer</ordername>
          <cost>35785638</cost>
        </order>
      </customer>
    </customers>
    SQL> select extract(details,'//order/ordername') XDATA
      2  from   xml_tab
      3  ;
    XDATA
    SQL> select extract(details,'//order/ordername','xmlns="http://orcl.com"') XDATA
      2  from   xml_tab
      3  ;
    XDATA
    <ordername xmlns="http://orcl.com">Computer</ordername>
    SQL> select extractValue(details,'//order/ordername','xmlns="http://orcl.com"') XDATA
      2  from   xml_tab
      3  ;
    XDATA
    Computer
    SQL> select extractValue(details,'/*/*/order/ordername','xmlns="http://orcl.com"') XDATA
      2  from   xml_tab
      3  ;
    XDATA
    Computer

  • One application with Multiple schemas- common application frame work

    Hi All,
    I am trying setup a common application frame work in apex. Please help me.
    How to achieve this.
    Creation of one application attached to different schemas at run time. So that my application maintaince is going to be easy instated of creating copies of same application.
    More details:
    1. I have one application with 100 pages pointing to a schema dev_common in one workspace APP_COMMON. I have 50 schemas with same structure of dev_common schema with different set of data ( because of large amount of data).
    So I want to create one application attached to different schemas.
    2. And another thing is I have 100 users, the user can work on 1 or multiple schemas ( I mean same application with different schemas attached)
    Any help much appreciated.
    Thanks,

    Thank you for the reply.
    >> b) I think you have to give access rights for the dev_common and app_common to all users.
    Dev_common schema is a kind of placeholder. I have 50 schemas same as dev_common because of different business requirements but the front end is same for all 50 schemas. How can we create one application used for 50 schemas instead of creating 50 applications and 50 workspaces.
    Please help me.

  • How to develope application with multiple schema

    Hi,
    In my application, there is 3 schema, forms are from different schema, but the database is one. How should I manage it, When i open the form with different schema I am not getting the expected result,
    I am using Oracle 10g Forms & Database
    Thanks in advance
    Rizly

    hi,
    what database-user is the user connected with, when executing the forms ? Is it one of the three schemaowners or has each logical user his own database-user?
    About your db-objects:
    I would create 3 roles, one for each schema, and grant the needed privileges for one schema to the according role
    Example:
    CREATE ROLE RL_SCHEMA1;
    GRANT SELECT, INSERT, UPDATE, DELETE ON SCHEMA1.TABLE RO RL_SCHEMA1;
    ...Then you can grant the roles to the databaseuser you are connected with at runtime.
    If you use named users (each logical user has it's own database-user) then you assign each user only those roles he needs.

  • ORA-00600 problem when create XMLType table with registerd schema

    Hi,
    I am using Oracle9i Enterprise Edition Release 9.2.0.4.0 on RedHat Linux 7.2
    I found a problem when I create table with registered schema with follow content:
         <xs:element name="body">
              <xs:complexType>
                   <xs:sequence>
                   </xs:sequence>
                   <xs:attribute name="id" type="xs:ID"/>
                   <xs:attribute name="class" type="xs:NMTOKENS"/>
                   <xs:attribute name="style" type="xs:string"/>
              </xs:complexType>
         </xs:element>
         <xs:element name="body.content">
              <xs:complexType>
                   <xs:choice minOccurs="0" maxOccurs="unbounded">
                        <xs:element ref="p"/>
                        <xs:element ref="hl2"/>
                        <xs:element ref="nitf-table"/>
                        <xs:element ref="ol"/>
                   </xs:choice>
                   <xs:attribute name="id" type="xs:ID"/>
              </xs:complexType>
         </xs:element>
    Does Oracle not support element reference to other element with dot?
    For instance, body -> body.content
    Thanks for your attention.

    Sorry, amendment on the schema
         <xs:element name="body">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="body.head" minOccurs="0"/>
                        <xs:element ref="body.content" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="body.end" minOccurs="0"/>
                   </xs:sequence>
                   <xs:attribute name="id" type="xs:ID"/>
                   <xs:attribute name="class" type="xs:NMTOKENS"/>
                   <xs:attribute name="style" type="xs:string"/>
              </xs:complexType>
         </xs:element>

Maybe you are looking for

  • Adobe Flash Player ActiveX deployment doesn´t work in SCCM 2012 R2

    I´ve created an Application to deploy Adobe Flash Player 15.0.0.189 (last version). I´ve tried to deploy with the msi downloaded from Adobe site, using Powershell App Deploy Toolkit, bat script.. but nothing seems to work 100%. I have 2500 computers

  • Exporting to PDF shrink the fontsize

    Hi, Crystal shrinks the font size while exporting to the pdf. In report fort size is 8 but in PDF it seems like 7 i found one registry than you can add in registry and its work fine but you use registry then its cutting  text at right handside for RT

  • IDOC status 30 even if I set transfer IDoc immediately in we20

    Hi All, I am creating Bommat IDocs using 'MASTER_IDOC_DISTRIBUTE'  .I am getting the 30 status instead of getting status 3. Even   if I set transfer IDoc immediately in we20. Please let me know how to resolve this. Thanks, Vinay.

  • Siebel Analytics using HTTPS

    Hi, Does anyone know if this is possible if your using 10g DB / Application Server for Siebel Analytics 7.8.5? I have tried looking for documentation but unable to find any. Any help would be appreciated

  • Premiere CS6 crash with "serious problem"..on Macbook Pro?

    Every minute or two it will crash. I just recently bought the whole adobe suite and am mainly using premiere but I can't get anywhere with it continually crashing. My Mac info: Version 10.8.3 Processor: 2.53 GHz Intel Core i5 Memory: 4GB 1067 MHz DDR