Versioning of SAX, DOM in WSDP versus SDK

Packages for sax,dom etc provided in WSDP 1.1 are also in SDK 1.4
Will these be moved out of the SDK and kept in WSDP in the future?
Do the endorsed versions for WSDP differ at the present time?

Packages for sax,dom etc provided in WSDP 1.1 are also
in SDK 1.4
Will these be moved out of the SDK and kept in WSDP in
the future?
Do the endorsed versions for WSDP differ at the
present time?For J2SDk 1.4 the parser is crimson which does not support schemas. The jaxp jars in JWSDP contain most recent bugfixes and additional features. To override the older classes of jdk1.4 with the most recent one you need to use the endorsed standards. The future releases of JDK will contain sax, dom packages and maybe additional features but they will not be removed from the jdk.
Regards,
Bhakti

Similar Messages

  • XML Validation using XDK SAX/DOM Parser

    Hello,
    I am trying to validate xml against xsd using SAX/DOM parser, both the files are stored as CLOB column in the database. I have the requirement to report all the validation errors and based on some helpful advice/code from the earlier posts in this forum, I have used the following code to validate and report the errors.
    The code works fine but for large files it never goes beyond a certain number of errors i.e. getNumMessages() (XMLParseException) never returns value greater than 100 and thus limits the output of the validation errors. Any pointers to suggest change in code or an alternative will be extremely helpful.
    Datebase Version : Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED <> as package <package name>;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.sql.SQLException;
    import oracle.sql.CLOB;
    import oracle.xml.parser.schema.*;
    import oracle.xml.parser.v2.*;
    import org.w3c.dom.*;
    public class XMLSchemaVal
    public static String validate(CLOB xmlDoc, CLOB xsdDoc)
    throws Exception
    //Build Schema Object
    XSDBuilder builder = new XSDBuilder();
    Reader xsdInUnicodeFormat = xsdDoc.getCharacterStream();
    XMLSchema schemadoc = (XMLSchema)builder.build(xsdInUnicodeFormat, null);
    //Build XML Object
    Reader xmlInUnicodeFormat = xmlDoc.getCharacterStream();
    // Genereate the SAX
    SAXParser saxparser_doc = new SAXParser();
    // Set Schema Object for Validation
    saxparser_doc.setXMLSchema(schemadoc);
    saxparser_doc.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    saxparser_doc.setPreserveWhitespace (true);
    String returnValue;
    try {
    saxparser_doc.parse (xmlInUnicodeFormat);
    returnValue = "The input XML parsed without errors.\n";
    catch (XMLParseException se) {
    returnValue = "Parser Exception: ";
    for (int i=0 ; i < se.getNumMessages(); i++)
    returnValue += "<LN: " + se.getLineNumber(i) + ">: " + se.getMessage(i);
    //returnValue = "Parser Exception: " + se.getNumMessages();
    catch (Exception e) {
    returnValue = "NonParserException: " + e.getMessage();
    return returnValue;
    Function to call the above utility from PL/SQL
    CREATE OR REPLACE FUNCTION F_XMLSCHEMAVALIDATION (P_XML IN clob ,P_XSD IN clob) RETURN VARCHAR2 IS
    LANGUAGE JAVA NAME XMLSchemaVal.validate(oracle.sql.CLOB,oracle.sql.CLOB) return java.lang.String';
    Thanks.

    Got the answer !!!
    NetBeans it self support generation of dtd file based on XML file.
    Open XML file and right click on the code block. Select option to generate dtd file.
    This is the drtd file it has generated..
    <?xml version='1.0' encoding='UTF-8'?>
    <!--- Put your DTDDoc comment here. -->
    <!ELEMENT book (person)*>
    <!--- Put your DTDDoc comment here. -->
    <!ELEMENT person (age|last|first)*>
    <!--- Put your DTDDoc comment here. -->
    <!ELEMENT first (#PCDATA)>
    <!--- Put your DTDDoc comment here. -->
    <!ELEMENT last (#PCDATA)>
    <!--- Put your DTDDoc comment here. -->
    <!ELEMENT age (#PCDATA)>

  • Choosing between SAX & DOM & StringBuffer class for writing XML

    Hii Javaties
    I need to create a XML document from a swing application.
    I need to store this xml in a file.
    For writing XML which parser should i use SAX or DOM or should i go for StringBuffer class.

    I'm not aware of a way to use SAX to create an XML document. It is used to view the contents of an existing XML document or data that is well-structured.
    That leaves you with a choice of DOM or StringBuffer. We cannot tell enought about what you are doing to know which is better. Each has some advantages and disadvantages.
    StringBuffer:
    + less overhead
    - no assistance in ensuring the validity of the result
    + greater control over layout of resulting document (how and when to indent)
    - any control over layout must be done by you.
    DOM (although this task is easier in JDOM)
    - more overhead
    - some learning curve
    + result is guaranteed to be valid XML.
    + there are pretty formatters to generate good looking results
    - there may be layout choices that the standard pretty formatters cannot do
    As an example, consider this part of the Document being created.
    You want <name>John Doe</name>
    With a StringBuffer, you can just add these pieces. With DOM, you need to:
    1) create an Element named "name".
    2) create a Text object with a value of "John Doe".
    3) add the Text object as a child of the Element
    4) add the Element to the parent
    Having done the DOM version (also a JDOM version) several times, I have developed an XMLHelper class that has several static methods to make simple, common constructs.
    It lets me do things like:
    parent.addChild( XmlHelper.makeElement( "name", customerName ) );
    So, the answer to your question is the same as many other questions: It depends.
    Dave Patterson

  • [CDATA] not the same way read in DOM and SAX (DOM: O.K., SAX: not O.K.)

    I wrote a test application that reads a XML file. First method reads it via DOM in a Document object, second that reads it via SAX in a string. The output is almost the same but the character data is different:
    while the dom outout is as expected:
    <hap>EUSF</hap>
    <name><![CDATA[WADDELL&REED ADV BOND CL Y]]></name>
    the SAX output is different:
    <hap>EUSF</hap>
    <name>WADDELL&REED ADV BOND CL Y</name>
    as both elements have text data, only the second is enclosed in a <![CDATA]> value. The DOM output is the same as when displayed the XML in internet explorer, so i guess this is the correct result. but my SAX reader does not display the <![CDATA]> value ...
    to get the sax output i subclassed DefaultHandler and overwrote the methods like described in the Web Service Tutorial "Echoing an XML File with the SAX Parser" (http://java.sun.com/webservices/docs/ea2/tutorial/doc/JAXPSAX3.html#64190):
    * Overwrites super.
    * Receive notification of character data inside an element.
    public void characters(char buf[], int offset, int len) {
    String s = new String(buf, offset, len);
    if (!s.trim().equals("")) { //suppress output of characters that are all whitespace
    write(s);
    }//characters()
    the characters() method has the content of an element, but it has not the information if a CDATA is enclosing the data or not(?). How can this be done?

    There's a thing called a LexicalHandler (org.xml.sax.ext.LexicalHandler) that has startCDATA and endCDATA methods. The API documentation suggests that you could create your own LexicalHandler and use it somehow, but it doesn't give you a nicely packaged example. I don't have an example of it either, sorry.
    However despite what you say, those two outputs are not different. In XML terms they are identical and parsers will treat them identically.

  • Making use of a schema in SAX/DOM? (w/jdk 1.5 xml libraries)

    I have a simple function that I wrote to validate some xml...
        public void validate(String xmlURI) throws SAXException, IOException  {
         XMLReader parser = XMLReaderFactory.createXMLReader();
         parser.setFeature("http://xml.org/sax/features/validation", true);
         parser.parse(xmlURI);
        }I have the following simple schema...
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
         <xs:element name="blah" type="xs:string"/>
         <xs:element name="junk">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="blah"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>I have a unit test that runs some non-conforming XML though the process, and I have two questions about that.
    XML...
    <?xml version="1.0" encoding="UTF-8"?>
    <junk xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="TestSchema.xsd">
         <blah2>blah</blah2>
    </junk>
    Question #1: It can't find the stylesheet (which is located in the same directory). How do I do that correctly?
    Output to stderr...
    [Error] ValidatorTestBad.xml:2:6: Document is invalid: no grammar found.
    [Error] ValidatorTestBad.xml:2:6: Document root element "junk", must match DOCTY
    PE root "null".
    Question #2:
    Printing the messages to stderr isn't very useful behavior. How do I get the parser to throw an exception?
    Thanks.

                reader.setFeature("http://xml.org/sax/features/validation", true);
                reader.setFeature("http://apache.org/xml/features/validation/schema", true);
          reader.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",  XSDSchemaString);
           

  • Guide Lines to Use SAX,DOM using javax.xml. * files only, I

    Hi Respected Recievers,
    My Name is Surya, i am working as a Java
    Programmer.
    I need JAR files to run SAX and DOM properly.
    I don't want to Use xerces.jar or jaxp.jar files, i will use only javax.xml.* files only.
    Could provide some examples on those topics like reading,modifying,the files using SAX and DOM.
    Thanks&Regards
    Surya

    Add rt.jar to Classpath.
    DOM Tutorial
    http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXPDOM3.html
    SAX tutorial
    http://java.sun.com/j2ee/1.4/docs/tutorial-update2/doc/JAXPSAX.html

  • Version issue of base SAP DCs versus Runtime libraries

    I have created a DC project of type Web Dynpro. In JDI my track is defined with the 3 base dependent DCs (SAP-JEE, SAP-JTECHS, SAP-BUILDT). I am able to sync used DCs and have locally.
    When I try to build a very simple project I get the following build error "com.sap.tc.webdynpro.progmodel.api.IWDApplicationStateChangeInfo cannot be resolved (or is not a valid type) for the argument stateChangeInfo of the method wdDoApplicationStateChange".
    What I discovered is that the class "wdDoApplicationStateChange" does not exist in the "_webdynpro_progmodel.jar" file that was sync'd as part of the SAP-JEE DC BUT when I look at the WD runtime libraries that is part of my Studio install that class does exist in the jar file.
    If I create the same application as a standalone Web Dynpro project, it builds locally successfully and when I deploy it to the Portal it runs perfectly.
    Therefore it seems I need to deal with 3 versions of the same libraries:
    1. The local WD runtime that comes with the Studio install.
    2. The libraries that come when sync'ing used DCs (i.e. SAP-JEE, SAP-JTECHS, SAP-BUILDT).
    3. The actual runtime on the portal.
    Questions:
    - How can we verify we have imported the correct version of the used DCs (i.e. SAP-JEE, SAP-JTECHS, SAP-BUILDT) in the JDI so the related libraries match the actual runtime?
    - Is there somewhere on SDN or other SAP site a version roadmap of these SAP supplied DCs?
    I tried to find documentation/references related to versioning of these SAP supplied DCs and could not find anything helpful.
    Even our BASIS administrator is having trouble identifying the correct versions.

    Pascal,
    you mention the following:
    The SP level of the three base SCs MUST match the SP level of your target runtime systems. It is also adviseable to have your NWDS at this same SP level (especially when you are building Web Dynpro's).
    So can you help here...
    We have modified the source code of the following version of the NW2004 ESS component: SAP_ESS 100 sp16
    We would like to plan to upgrade to the following version of the NW2004s ESS component: SAP_ESS 600 sp12
    The "NWDI Cookbook for XSS Customers" seems to only document the procedure and migration path on how to upgrade from one sp to the next sp WITHIN THE SAME VERSION.
    (For Example: SAP_ESS 100 sp16 to SAP_ESS 100 sp19)
    We need to know the migration path and process for upgrading from NW2004 to NW2004s. 
    (For Example: SAP_ESS 100 sp16 to SAP_ESS 600 sp12)
    My hunch is we will follow a similar process, however, questions around what version of NWDS do we need to use for handling both the NW04 and NW04s component in using the Meta-Data Comparison Tool.  If we need to always make sure our NWDS matchs our target J2EE Server Version, how will this work when we are working with 2 different J2EE server versions during the upgrade? (NW04 and NW04s)

  • Vm version of for eclipse with oepe versus wls vm

    I went through some old posts and seem to fnd that both WLS and eclipse need to be started with the same vm ?
    This is a basic question, but my web app is for java5, what problems could I encounter if I try to run the java5 webapp on a WL server running on java 6
    thankyou

    both WLS and eclipse need to be started with the same vm That is incorrect. Java version requirements for Eclipse and OEPE are independent from java version you build your app to and are independent from java version that WLS is running with.
    You can target your app to Java 1.4, run OEPE with Java 1.6 and deploy to WLS that runs on Java 1.5.
    This is a basic question, but my web app is for java5, what problems could I
    encounter if I try to run the java5 webapp on a WL server running on java 6 thankyouThe tooling will help make sure that you don't get a configuration that will not work. It is perfectly fine to have an app that targets java version that's older than what WLS running with. Java is backwards compatible and so is WLS.
    - Konstantin

  • Can i use SAX,DOM or JDOM within JAX-RPC ?

    Dear all,
    Im trying to create a web service , with methods that recive Element parameters (which i changed to strings) , and then parsing my xml node and returning objects. Im facing this error while creating the web service files: "java.loang.StackTraceElement does not have a public accessible empty constructor" .... This error appears with using one of the XML parsers ... an example of one method:
    public QuizInfo readXmlFile(int id, String clientId, String distId) throws RemoteException,org.jdom.JDOMException, Exception
          QuizInfo QuizObj = new QuizInfo();
           SAXBuilder builder = new SAXBuilder();
           Document doc = builder.build(new File( "c:quiz.xml"));
           Element firstNode = doc.getRootElement();
    .....can I use any xml parser within a method that i will use in my JAX-RPC web service ? and if , can anyone show me how ?
    thanx in advance

    Dear all ..... I found it !!!
    first of all , make sure that all the names of your methods used in your web service begins with a small letter !! thats one ... another thing is that i made another class that only calls the methods of the original class with the implementation , example of what im saying , remember the readXmlFile in the original class ... ok .. make another class, lets say its called CallServiceClass , with a method that calls the readXmlFile method in the originalService
    public QuizInfo readXmlFile(int id, String clientId, String distId) throws Exception{
              return originalService.readXmlFile( id,  clientId,  distId);
         }and then create the web service from the new class CallServiceClass !
    note that i threw an Exception , not a JDomException ... also note that for some IDEs , it will require that the method is a static method.

  • XML validation using XDK DOM/SAX Parser

    Hello,
    I am trying to validate xml against xsd using SAX/DOM parser, both the files are stored as CLOB column in the database. I have the requirement to report all the validation errors and based on some helpful advice/code from the earlier posts in this forum, I have used the following code to validate and report the errors.
    The code works fine but for large files it never goes beyond a certain number of errors i.e. getNumMessages() (XMLParseException) never returns value greater than 100 and thus limits the output of the validation errors. Any pointers to suggest change in code or an alternative will be extremely helpful.
    Datebase Version : Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED as package <package name>;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.sql.SQLException;
    import oracle.sql.CLOB;
    import oracle.xml.parser.schema.*;
    import oracle.xml.parser.v2.*;
    import org.w3c.dom.*;
    public class XMLSchemaVal
    public static String validate(CLOB xmlDoc, CLOB xsdDoc)
    throws Exception
    //Build Schema Object
    XSDBuilder builder = new XSDBuilder();
    Reader xsdInUnicodeFormat = xsdDoc.getCharacterStream();
    XMLSchema schemadoc = (XMLSchema)builder.build(xsdInUnicodeFormat, null);
    //Build XML Object
    Reader xmlInUnicodeFormat = xmlDoc.getCharacterStream();
    // Genereate the SAX
    SAXParser saxparser_doc = new SAXParser();
    // Set Schema Object for Validation
    saxparser_doc.setXMLSchema(schemadoc);
    saxparser_doc.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    saxparser_doc.setPreserveWhitespace (true);
    String returnValue;
    try {
    saxparser_doc.parse (xmlInUnicodeFormat);
    returnValue = "The input XML parsed without errors.\n";
    catch (XMLParseException se) {
    returnValue = "Parser Exception: ";
    for (int i=0 ; i < se.getNumMessages(); i++)
    returnValue += "<LN: " + se.getLineNumber(i) + ">: " + se.getMessage(i);
    //returnValue = "Parser Exception: " + se.getNumMessages();
    catch (Exception e) {
    returnValue = "NonParserException: " + e.getMessage();
    return returnValue;
    Function to call the above utility from PL/SQL
    CREATE OR REPLACE FUNCTION F_XMLSCHEMAVALIDATION (P_XML IN clob ,P_XSD IN clob) RETURN VARCHAR2 IS
    LANGUAGE JAVA NAME XMLSchemaVal.validate(oracle.sql.CLOB,oracle.sql.CLOB) return java.lang.String';
    Thanks.

    I have the same question. I have an external DTD. I wish to parse an xml file using XMLParser.xmlparse. If I first call XMLParser.xmlparseDTD and then call xmlparse with the XML_FLAG_VALIDATE will the xml automatically be validated against the previously parsed DTD? There is no DOCTYPE declaration in the xml file.
    The demo code on OTN for Java is great but has no relation to the code you would use in C++ (no set functions in C++).

  • In Java Mapping Whether to SAX or DOM ?

    While implementing Java Mapping which of the following SAX , DOM parsers  is the most efficient way to implement it.
    I mean considering the voulume of data in the XML format is large which  usage will give me most  optimal performance .
    It would be nice if someone could give a sample most  optimal java code using JAXP where  input stream is read  and after  processing written to  output stream.
    regards
    Nilesh Taunk.

    Hi Nilesh,
    >>>While implementing Java Mapping which of the following SAX , DOM parsers is the most efficient way to implement it.
    there's no one good answer fot this question
    except: it depends:)
    SAX and DOM are a little different parsers
    so it depends what will your java mapping
    have to do: if it will change the
    structure or maybe it will only change a few tags,
    or maybe it will do something else
    have a look at the page below to read a simple
    comparision between SAX and DOM
    http://www.scit.wlv.ac.uk/~jphb/cp2101/week4/XML_Parsing.html
    or this thread:
    http://www.biglist.com/lists/xsl-list/archives/200301/msg01318.html
    they will give you some idea which one to choose
    depending on your requirements
    BTW
    remember use java mappings only
    if you cannot use graphical mapping (very easy debugging)
    and if your document cannot be parsed (maybe huge documents)
    with XSLT which is supported by many graphilal tools
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

  • Flash Builder 4 Premium reverts to trial version for SDK 4.5.1.

    My setup:
    Windows 7 and Mac OS X 10.6
    Flash Builder 4 Premium, Version 4.0 (build 272416), volume license
    SDK 4.5.1, Flex 3 compatibility mode enabled
    RIATest 4.3 Professional
    RIATest compiled-in agent: RIATestAgent3.swc
    When running RIATest against our application to perform automated tests, I eventually get this alert appearing in  our application:
    |                                                                |
    |----------------------------------------------------------------|
    |                                                                |
    |    License not present. With the trial version only limited    |
    |    replays are allowed.                                        |
    |                                                                |
    |                            [  OK  ]                            |
    This alert never appeared until we upgraded from SDK 3.4.1 to SDK 4.5.1. This problem occurs on Windows 7 and Mac OS X. I updated our code to disable Flex 3 compatibility and use the RIATest agent, RIATestAgent4.swc. This did not change the outcome. Since this is an Adobe licensing issue, there is nothing the makers of RIATest (Cogitek) can do to help me other than to tell me to press the matter with Adobe. I'm using the same legitimate/legal/valid Flash Builder Premium and RIATest licenses as I've been using for a year now.
    Why do I need a new license to perform automated tests against SDK 4.5.1? What license would that be?

    In order for you to downgrade you need to hava an AVL license, and yes it is possible, you just need to call support.
    http://www.adobe.com/volume-licensing/policies.html
    Check Backward licensing policy
    "Adobe allows program members to order a current-version license but use a prior version. These members can contact Adobe Customer Service to request a serial number for the earlier version if they do not already have one. Prior-version software is available via ESD and can be purchased through standard resellers. The program member must follow all guidelines of the current-version EULA.
    Note: This policy is applicable under the TLP and Forms Licensing Program (FLP) as well."
    Hope it helps!

  • 1.4.2_03 SDK install problem (WinXP SP1)

    I just installed j2sdk 1.4.2_03 (freshly downloaded), and installed on my WinXP SP1 laptop.
    * The install croaked at the point at which it tried to install the standalone JRE (threw up an error dialog, and if you hit OK on that, it exits the install without installing the JRE).
    * At that point, if I do "c:\j2sdk1.4.2_03\bin\java -version" (to check the version of the JRE contained in the SDK), it says "build 1.4.2-b28" (!!!). (I don't have any other JREs installed anywhere, and verified that it was indeed picking up the JRE from c:\j2sdk1.4.2_03\jre.)
    Did the 1.4.2_03 SDK go out with a bad JRE bundled? The 1.4.2_02 SDK correctly identifies itself (java -version) as "build 1.4.2_02-b03", and I've uninstalled everything and rolled back to that version of both the JRE and SDK, and everything works fine now (installs flawlessly).

    I am seeing the same problem with the j2sdk1.4.2_03 SDK and JRE installers. The error showing up on XP is "Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor." The install then exits with the package in a partial state and must be uninstalled. I also see the same problem when installing the older j2sdk1.4.2_03 SDK. Sounds like there is return state that is not being handled correctly in the package installer. Any ideas on how to fix this problem?
    Thanks
    Mark

  • CS5 SDK Error compiling Adobe examples.

    Hi,
    I downloaded the trial version of Illustrator CS5 and the CS5 SDK to be able to adapt my plugins.
    These plugins are for CS4.
    Each time I try to compile one of the samples provided in the CS5 SDK, I have the same error
    error: extra qualification 'AIPlatformFileDlgOpts::' on member 'AIPlatformFileDlgOpts'
    Do you Know what to modify to avoid this error.
    I use XCode 3.2.2 and MacOS.
    Please help me.
    JLG.

    I just had the very same problem. I changed the compiler from GCC 4.2 to GCC 4.0 in the project settings. That did the trick.

  • Flex 4 SDK beta 2 download

    There's no beta 2 sdk download. At the top of the beta 2 download page it says...
    "As a reminder, everything that is in the Flex 4 SDK is also included in Flash Builder 4, so you will not need to download the SDK if you plan on using Flash Builder."
    But if you download the win version of Flash Builder the beta 2 SDK  only has  the win version of the Adobe AIR Runtime.
    If you download the Mac version of Flash Builder the beta 2 SDK  only has  the Mac version of the Adobe AIR Runtime.
    You need to manually merge these to make a full SDK.
    This was discovered because we check in the SDK into perforce... and when people tried to execute our AIR based test runner on both win and mac when we only had the win version of the adobe air runtime checked in... we got "Adobe AIR could not be found" on the mac versions.
    After copying the mac version into the SDK and checking it in... it worked just fine.

    It's probably best to file a bug at http://bugs.adobe.com/flex/ (not sure if this would potentially be an SDK issue or a Builder issue, but we can move it after the fact if it should belong somewhere else).
    Also, if you post the bug number here, I can try and speed it through the process.
    Peter

Maybe you are looking for