JAXP parser and schema

I have a schema which use <xs:include> to include different schema.
When creating XML DOM parser I handled the schema and it's location
on the disk.
When running the XML parser, I handled it XML file which located in the
same directory in the disk where the 2 schemas located, and it works
well.
The problem is when I move the XML file to different directory on the
disk the parser shouts that it can not find the schema.
I tried to use URI in the include, but it didn't work as well.
I will appreciate your help
Thanks.

Specify relative path of schema, schemaLocation="/schema.xsd"
or absolute path of schema, schemaLocation="c:/schema.xsd"

Similar Messages

  • Memory Leakage while parsing and schema validation

    It seems there is some kind of memory leakage. I was using xdk 9.2.0.2.0. Later i found that from this forum which contain a Topic on this and they (oracle ) claim they have memory leakage. And they have fixes this bugs in 9.2.0.6.0 xdk. When i used truss command, for each call to parser and schame validation, it was opening file descriptor for lpxus and lsxus file. And this connections were not close. And keep on openning it with each call to parser. I was able to diagonise this using truss command on on solaris. After making many calls, i was error message could not open file Result.xsd (0202). I am using one instance of Parser and Schema. And i am doing clean up for parser after each parse.
    Later i downloaded, 9.2.0.6.0,
    Above problem for the parser was solvedm but still the problem continued for schema validation. And even i tried with latest beta release 10.
    And this has caused great troubles to us. Please can u look whether there is come sort of leakage. Please advice if u have any solution.
    Code---
    This below code is called multiple times
    char* APIParser::execute(const char* xmlInput) {
              char* parseResult = parseDocument(xmlInput);
              //if(strcmp(parseResult,(const char*)"")==0) {
    if(parseResult == NULL) {
                   parseResult = getResult();
    parser.xmlclean();
         return parseResult;
              } else {
                   return parseResult;
    Parser and schema are intialised in Construtor and terminated in Destructor.

    Hi, here is the complete test case
    #include<iostream>
    #ifndef ORAXML_CPP_ORACLE
    # include <oraxml.hpp>
    #endif
    using namespace std;
    #define FAIL { cout << "Failed!\n"; return ; }
    void mytest(int count)
         uword ecode;
         XMLParser parser;
         Document *doc;
         Element root, elem;
         if (ecode = parser.xmlinit())
              cout << "Failed to initialze XML parser, error " << ecode << "\n";
              return ;
         cout << "\nCreating new document...\n";
         if (!(doc = parser.createDocument((oratext *) 0, (oratext *) 0,(DocumentType *) 0)))
         FAIL
         if (!(elem = doc->createElement((oratext *) "ROOT")))
                   FAIL
         string test="Elem";
         for(int i=0;i<count;i++)
              //test="Elem"+string(ltoa(i));
              if (!(elem = doc->createElement((oratext *) "element")))
                   FAIL
              if (!doc->appendChild(elem))
                   FAIL
         //doc ->print();
         //parser.xmlclean();
         parser.xmlterm();
    int main(int argc,char* argv[])
         int count=atol(argv[1]);
         mytest(count);
         char c;
         cout<<"check memory usage n press any key"<<endl;
         cin>>c;
         return 0;
    -------------------------------------------cut here-----
    Now, i cant use the xdk 10g because i work on a hpux machine. I have tried the above program with a count of 1000000. the memory usage at the end was around 2 gigabytes.
    Could someone please please help me? :(
    Thank you.

  • Oracle XML parser and schema validation

    Hi Forum,
    I have problem parsing XML with validation against XML schema. I define location of schema (URL) in xml file and Oracle parser could not find the schema (xml file is correct - checked in other programs). When I point to xml schema directly from Java (using parser.setXMLSchema) before calling parser.parse, it works just fine. Where is the problem? Does oracle parser works correctly with XML Schema?
    TIA,
    Alex

    SAXParser saxParser=new SAXParser();
    saxParser.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    Specify a Schema to validate a XML document with, for the SAXParser.
    saxParser.setXMLSchema(SchemaUrl);
    DefaultHandler handler=new DefaultHandler();
    saxParser.setErrorHandler(handler);
    Parse the XML document to validate with the XML schema.
    saxParser.parse(XmlDocumentUrl);

  • JAXP(DOM) and schema's

    Is it possible to process a document with a schema with DOM. I know it is possible with SAX but i was not sure if it was with DOM and i didn't want to get started on something that is not possible. Althought i would expect that i can seeing as schema's are W3C's standard. Thank you.

    Hello one & all
    I have to parse two xml files (same format but different values) and print the mismatch, if any elementwise..
    I am trying to create dom for these two files butafter that not able to traverse the xml file element wise (as it is a complex file, nested elements ).
    can any one guide me appropriately how to do this.with steps.
    Its urgent.

  • Question About Xerces Parser and Java  JAXP

    Hi,
    I have confusion about both of these API Xerces Parser and Java JAXP ,
    Please tell me both are used for same purpose like parsing xml document and one is by Apache and one is by sun ?
    And both can parse in SAX, or DOM model ?
    Is there any difference in performane if i use xerces in my program rather then JAXP, or is ther any other glance at all.
    Please suggest some thing i have and xml document and i want to parse it.
    Thanks

    Hi
    Xerces is Apaches implementation of W3C Dom specifiacation.
    JAXP is a API for XML parsing its not implementation.
    Sun ships a default implementation for JAXP.
    you have factory methods for selecting a parser at run time or you can set in some config file about what is the implementaion class for the SAXParser is to be chosen (typically you give give the class file of xerces sax parser or dom parser etc..)
    go to IBM Developerworks site and serch for Xerces parser config. which have a good explination of how to do it.
    and browse through j2ee api .may find how to do it.

  • Problem in parsing XML Schema

    I am trying to parse XML Schema using XSOM. The Schema has <xs:include>s
    e.g. I have first.xsd which includes second.xsd and second.xsd again includes third.xsd.
    First.xsd
    <xs:include schemaLocation="../Second.xsd">....
    Second.xsd
    <xs:include schemaLocation="Third.xsd">....
    When I parse "First.xsd" parser passes the correct path "C:/XSDSchema/Second.xsd"(First.xsd resides in "C:/XSDSchema/Schema/") to the EntityResolver's resolveEntity method. But for Second.xsd it passes "Third.xsd" only (Third.xsd resides in "C:/XSDSchema/" ) .
    Any Idea ?????

    Here is a screenshort of the part of my workflow:
    In the mappings of the "Set Value" activity, I have one line with those properties:
    Location: /process_data/bonusValidationForm/object/data/xdp/datasets/data/BonusValidationForm/buMan agerID
    Expression: /process_data/currentUser/object/@userId
    Where:
    bonusValidationForm is a process variable of my workflow that point my xdp form
    buManagerID is the textfield I want to set
    currentUser is a process variable (type User) that was well setted by the task Find BU Manager

  • Problem with JDOM and schemas

    I'm trying to parse (and validate) an XML document with JDOM.
    My root element is declared in the schaema whixh is asociated to the document.
    But during parsing, an exception saying that my root element is not declared is thrown.
    Can someone axplain to me what can happen ?
    Thank's

    What's this element ?
    My schema is indicated by the xsi:schemeLocation attribute of my root-element .

  • Error in XML Parsing  through Schema doc.MalformedURLException

    Hi,
    I need to validate xml file before parsing it through XML schema validation. My XML file and schema files are in the same directory and I need am validation it using below code.
    Java Code_
    String rbBasePath = ConfigurationFactory.getInstance().getConfigurations("ConfigParam").get("config.rb.properties", DEFAULT_RB_PATH);
    InputSource xmlInputSource = new InputSource (rbBasePath + ConfigConstants.XML_FILE_NAME);
    File schemaFileObj = new File (rbBasePath + ConfigConstants.XML_SCHEMA_FILE_NAME);
    SAXSource source = new SAXSource (xmlInputSource);
    SchemaFactory sf = SchemaFactory.newInstance (XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema schema = sf.newSchema (schemaFileObj);
    Validator validator = schema.newValidator ();
    validator.setErrorHandler (new ParserErrorHandler());
    validator.validate (source);
    But, I am getting following error.
    java.net.MalformedURLException: unknown protocol: c_
    After some google, I found there may be some bug which does not read the file if file path contains some space in between. But in my case schema path does not contain any space in between.
    Please help to figure out this issue.
    Edited by: Jaykishan on Jul 20, 2011 12:17 PM
    Edited by: Jaykishan on Jul 20, 2011 12:18 PM

    Error occurs at below line of code.
    validator.validate (source);
    Error message: MalformedURLException. java.net.MalformedURLException: unknown protocol: c
    My xml and xsd file is located at: C:\config\resources\AlertData.xml, C:\config\resources\AlertDataSchema.xsd.

  • Error Workspace 1655429769781901 has no privileges to parse as schema BUDGE

    Hi,
    i imported an old Application (HTMLDB 2.0) into the user old_schema (owner of the table) using SQL*Plus into APEX 4.0.2. After defining the security grup by the procedure set_security_group_id I couls import the old application.
    When I tried to start the application as ADMIN or as OLD_SCHEMA I got the error "Error Workspace 1655429769781901 has no privileges to parse as schema BUDGET_INT"
    How can I do the privileges of BUDCET_INT to user OLD_SCHEMA or what can I do to prevent this error
    Regards
    Siegwin

    Hello Siegwin,
    >> i imported an old Application (HTMLDB 2.0) into the user old_schema (owner of the table) using SQL*Plus
    Is there a reason to use SQL*Plus over the APEX built-in import mechanism? The latter allows you to import the exported application into any workspace (without the need to know its ID), use current or new application ID and define the parsing (owner) schema. All that without manually editing the exported file.
    If possible, this should be your preferred option.
    >> How can I do the privileges of BUDCET_INT to user OLD_SCHEMA or what can I do to prevent this error
    Is BUDGET_INT the original schema of the application? If so, it’s hard coded in the exported file. You should look for the wwv_flow_api.create_flow procedure and change the p_owner parameter to your target schema.
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Author of Oracle Application Express 3.2 – The Essentials and More

  • ORACLEWEBROWSET :java.sql.SQLException: No valid JAXP parser property

    Hi I have a servlet that reqeusts an xml from another servlet this is the code:
    URL host = new URL(url);
    HttpURLConnection hostconn = (HttpURLConnection)host.openConnection();
    hostconn.connect();
    BufferedReader xml = new BufferedReader(new InputStreamReader(hostconn.getInputStream()));
    OracleWebRowSet wrs = new OracleWebRowSet();
    wrs.readXml(xml);
    I get the following error when I try to read the xml document (there is a valid xml document being passed):
    java.sql.SQLException: No valid JAXP parser property specified
    at oracle.jdbc.rowset.OracleWebRowSetXmlReaderImpl.readXML(OracleWebRowSetXmlReaderImpl.java:138)
    at oracle.jdbc.rowset.OracleWebRowSet.readXml(OracleWebRowSet.java:83)
    at com.startech.xml.WebRowSetClient.executeSearch(WebRowSetClient.java:65)
    at com.startech.xml.WebRowSetClient.main(WebRowSetClient.java:81)
    Pls could sum1 help thanks

    Hi,
    I hope you got rid of this problem by now. I too faced the same problem today while using OracleWebRowSet.readXML. I could able to find a workaround for this problem i.e.
    I added the required parser information to System.Properties as below:
    Properties p = new Properties(System.getProperties());
    p.put("javax.xml.parsers.SAXParserFactory","org.apache.xerces.jaxp.SAXParserFactoryImpl");
    System.setProperties(p);
    and it worked for me.
    Basically what OracleWebRowSet's implementation for ReadXML method does is, it performs a look up for SAXParserFactory implementations within the System properties - it then looks for any DOM implementation defined in System.properties; if none of them is available then it raises the exception
    java.sql.SQLException: No valid JAXP parser property specified
    - I believe this should work for you too. Please let me know if you got rid of this in any other way.
    Thanks & Regards
    Dandapani

  • Parse XML Schema File?

    Dear Sun Developer Network,
    I suppose maybe I should start at the beginning.
    Can anyone outline the first few steps involved in parsing an XML schema file into a traversable data structure in Java?
    I'd like to get a get a discussion started here about this, because I have some questions about the process as I currently understand it, and the more advanced (i'm supposing they're more advanced) questions that I've been asking in the past have gone completely unanswered in this forum. So perhaps, starting from the beginning, and working through to the difficulties I'm encountering would be a better approach to solving those issues.
    Thank you,
    Nels

    >
    Many thanks for your reply! My next question is,
    s, if parsing an XML schema file can be done with a
    SAX or dom parser, then why has Sun bothered to
    develop the JAXB api? What is the difference?
    Hi Nels,
    SAX and DOM are technologies for parsing and JAXB is a technology for databinding. They are 2 different technologies.
    Parsing gives you acess to raw xml
    DataBinding does the parsing and goes one step ahed and loads the data from xml to java objects. It is a higher level of abstraction over parsing
    schema is a specification which helps to define the rules for a valid xml document. It also happens to be xml. DTD is a kind of limited schema which is non xml.
    hope you got the diffrence.
    ps: did you try the -J-Xmx switch with javac to resolve yhe OutOfMemory exception I suggested in your previous post
    Regards,
    Rajagopal

  • Workspace 10 has no privileges to parse as schema APEX_030200.

    I'm installing apex 3.2 into a 10.2.0.3 database and the install went fine. I've followed the same procedures to install apex in several other database with the same characteristics and they are all running fine. But in this install I get the "Workspace 10 has no privileges to parse as schema APEX_030200." message with I try to load the Admin page for the first time.
    Any help is greatly appreciated!
    Ken
    PS. I just ran apxremov.sql and reinstalled and all is good now. I had no error messages in the original install, so don't know what that was all about. That a couple hours I'll never get back! :)
    Edited by: kenkrug on Jan 7, 2010 3:55 PM

    At your place, I would go through Upgrade Guide again, with special attention on grants and privileges.

  • Workspace has no privileges to parse as schema

    Hi,
    when i try to run the application appear this error Workspace has no privileges to parse as schema XXX
    Apex version = 3.2.0.00.27
    DB verison = 11g
    the workspace worked well until now
    please help
    regards

    Hi
    I think that after database upgrade from 9i to 11g the grants of the APEX users changed, and today to solve my first problem (i could't create new workspace) i grant some privilege to the user APEX_030200 and the user that now didn´t work.
    this is the grants
    GRANT CREATE CLUSTER TO "APEX_030200" WITH ADMIN OPTION;
    GRANT CREATE CLUSTER TO "XXX" WITH ADMIN OPTION;
    GRANT CREATE JOB TO "XXX" WITH ADMIN OPTION;
    GRANT CREATE JOB TO "APEX_030200" WITH ADMIN OPTION;
    GRANT CREATE ANY CONTEXT TO"XXX" WITH ADMIN OPTION;
    GRANT CREATE ANY CONTEXT TO"APEX_030200" WITH ADMIN OPTION;
    GRANT CREATE MATERIALIZED VIEW TO"XXX" WITH ADMIN OPTION;
    GRANT CREATE MATERIALIZED VIEW TO"APEX_030200" WITH ADMIN OPTION;
    revoke this grants?
    Note: the user XXX has the DBA role
    Thanks

  • No priviliges to parse as schema

    I have upgraded from 1.5 to 1.6. I checked the log and it shows no errors. I can access HTMLDB 1.6 without any problems however when I try to run any of the applications that I developed in 1.5 I get error "Error Workspace XXXXXX has no priviliges to parse as schema HR". When I go in as ADMIN and check the mapping between the workspace and the schema I can only see "invalid" schema. I tried to change the schema but when I select the LOV I only get few schemas displayed for selection. I can't see HR or OE schemas that do exist in my database and that I used for creating my applications.

    165127,
    From Part III, Administration, of the 1.6 User's Guide:
    Understanding Oracle Default Schema Restrictions
    When Oracle HTML DB installs, the Oracle HTML DB administrator does not have the ability to assign Oracle default schemas to workspaces. Default schemas (such as SYS, SYSTEM, and RMAN) are reserved by Oracle for various product features and for internal use. Access to a default schema can be a very powerful privilege. For example, a workspace with access to the default schema SYSTEM can run applications that parse as the SYSTEM user. In order for an Oracle HTML DB administrator to have the ability to assign Oracle default schemas, the database administrator (DBA) must explicitly grant the privilege. The DBA can remove this restriction and grant the privilege using SQL*Plus to run the HTMLDB_SITE_ADMIN_PRIVS.ALLOW procedure within the HTML DB engine schema. For example:  EXEC HTMLDB_SITE_ADMIN_PRIVS.ALLOW;The DBA can reimpose this restriction and revoke this privilege using the HTMLDB_SITE_ADMIN_PRIVS.RESTRICT procedure within the HTML DB engine schema. For example:  EXEC HTMLDB_SITE_ADMIN_PRIVS.RESTRICT;The DBA can determine the current status of the privilege using SQL*Plus to run the HTMLDB_SITE_ADMIN_PRIVS.REPORT procedure within the HTML DB engine schema. For example:  SET SERVEROUTPUT ON
      EXEC HTMLDB_SITE_ADMIN_PRIVS.REPORT;EXEC HTMLDB_SITE_ADMIN_PRIVS.REPORT returns number of rows in the wwv_flow_restrict_admin table. 0 rows means that the Oracle HTML DB administrator is restricted and may not assign Oracle default schemas to workspaces. One or more rows means that the Oracle HTML DB administrator may assign Oracle default schemas to workspaces.
    Scott

  • Parse and output XML document while preserving attribute order

    QUESTION: How can I take in an element with attributes from an XML and output the same element and attributes while preserving the order of those attributes?
    The following code will parse and XML document and generate (practically) unchanged output. However, all attributes are ordered a-z
    Example: The following element
    <work_item_type work_item_db_site="0000000000000000" work_item_db_id="0" work_item_type_code="3" user_tag_ident="Step" name="Work Step" gmt_last_updated="2008-12-31T18:00:00.000000000" last_upd_db_site="0000000000000000" last_upd_db_id="0" rstat_type_code="1">
    </work_item_type>is output as:
    <work_item_type gmt_last_updated="2008-12-31T18:00:00.000000000" last_upd_db_id="0" last_upd_db_site="0000000000000000" name="Work Step" rstat_type_code="1" user_tag_ident="Step" work_item_db_id="0" work_item_db_site="0000000000000000" work_item_type_code="3">
    </work_item_type>As you may notice, there is no difference in these besides order of the attributes!
    I am convened that the problem is not in the stylesheet.xslt but if you are not then it is posted bellow.
    Please, someone help me out with this! I have a feeling the solution is simple
    The following take the XML from source.xml and outputs it to DEST_filename with attributes in a-z order
    Code:
    private void OutputFile(String DEST_filename, String style_filename){
         //StreamSource stylesheet = new StreamSource(style_filename);
         try{
              File dest_file = new File(DEST_filename);
              if(!dest_file.exists())
                  dest_file.createNewFile();
              TransformerFactory tranFactory = TransformerFactory.newInstance();
              Transformer aTransformer = tranFactory.newTransformer();
              aTransformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
              Source src = new DOMSource("source.xml");
              Result dest = new StreamResult(dest_file);
              aTransformer.transform(src, dest);
              System.out.println("Finished");
         catch(Exception e){
              System.err.print(e);
              System.exit(-1);
        }

    You can't. The reason is, the XML Recommendation explicitly says the order of attributes is not significant. Therefore conforming XML serializers won't treat it as if it were significant.
    If you have an environment where you think that the order of attributes is significant, your first step should be to reconsider. Possibly it isn't really significant and you are over-reaching in some way. Or possibly someone writing requirements is ignorant of this fact and the requirement can be discarded.
    Or possibly your output is being given to somebody else who has a defective parser which expects the attributes to be in a particular order. You could quote the XML Recommendation to those people but often XML bozos are resistant to change. If you're stuck writing for that parser then you'll have to apply some non-XML processing to your output to fix it up on their behalf.

Maybe you are looking for

  • SOAP -Client Certificate Authentication in Receiver SOAP Adapter

    Dear All, We are working on the below scenario SAP R/3 System  -> XI/PI -> Proxy -> Customer In this, SAP R/3 System sends a IDOC and XI should give that XML Payload of IDOC to Customer. Cusomer gave us the WSDL file and also a Certificate for authen

  • Why is align stroke inside and outside not working correctly.

    I'm trying to add a stroke that's aligned to the outside of my path.  It appears to be offsetting the stroke *and* moving achor points at the same time.  It does the same kind of thing when I align the stroke to the inside.  It is fine when i align t

  • Simply stated, firefox no longer works for my husband. Firefox will not open when my husband is user.

    As a user, firefox will open for me. As a user, firefox will not open for my husband. Yesterday McAfee had to remotely turn the McAfee firewall back on. I don't know if during this process it somehow affected firefox.

  • How to add left push button column in REUSE_ALV_GRID

    Hi, I need to add the push button on the left most part of the grid which will enable the user to select multiple lines and do further processing. I'm currently using REUSE_ALV_GRID. I've tried to search but I only saw suggestions for ALV using OO. P

  • Cluster session replication

    Hi, CFMX 7.01 MULTISERVER: I am facing a problem, session are not replicating on two CF instances on same server. Below is Jrun log file error detail 30/05 17:18:10 error Setup of session replication failed. [1]java.rmi.RemoteException: The web appli