Problems With XMLParser V2 Validation?

I'm trying out the validation aspects of the XML Parser Version
2. The code below takes an XML file and a DTD file and does a
validating parse. When a try this on the sample family.xml and
family.dtd files it gives me an exception saying that the "dad"
attribute is not allowed (which it should be according to the
DTD).
Also, why does the dump out of the DTD not include all of the
declarations?
The output is ====>
Parsing [family.dtd]
DTD ==>
<!ELEMENT member ANY>
<!ATTLIST member memberid ID >
Switching validation on
Parsing [family.xml]
Exception [Illegal attribute name dad]
The code is ====>
import java.io.*;
import java.util.*;
import oracle.xml.parser.v2.*;
import org.w3c.dom.*;
public class XMLParserClient
public static void main(String args[])
try
String xmlFileName = args[0];
String dtdFileName = null;
if(args.length > 1) dtdFileName = args[1];
DOMParser domParser = new DOMParser();
if(dtdFileName != null)
// Parse the DTD from the file
FileReader dtdReader = new FileReader(dtdFileName);
System.out.println("Parsing [" + dtdFileName +
domParser.parseDTD( dtdReader, null);
DTD dtd = domParser.getDoctype();
// Dump out the DTD
StringWriter dtdStringWriter = new StringWriter();
PrintWriter dtdPrintWriter = new PrintWriter
(dtdStringWriter);
dtd.printExternalDTD(dtdPrintWriter);
String dtdString = dtdStringWriter.toString();
System.out.println("DTD ==>");
System.out.println(dtdString);
// Switch on validation
System.out.println("Switching validation on");
domParser.setDoctype(dtd);
domParser.setValidationMode(true);
// Parse the XML from the file
FileReader xmlReader = new FileReader(xmlFileName);
System.out.println("Parsing [" + xmlFileName + "]");
domParser.parse(xmlReader);
System.out.println("Parsed OK");
// Dump out the XML
System.out.println("Generating XML");
XMLDocument xmlDocument = domParser.getDocument();
StringWriter stringWriter = new StringWriter();
PrintWriter printWriter = new PrintWriter
(stringWriter);
xmlDocument.print(printWriter);
String xmlString = stringWriter.toString();
System.out.println("XML ==>");
System.out.println(xmlString);
catch(Exception exception)
System.out.println("Exception [" + exception + "]");
null

Dave Barton (guest) wrote:
: I'm trying out the validation aspects of the XML Parser Version
: 2. The code below takes an XML file and a DTD file and does a
: validating parse. When a try this on the sample family.xml and
: family.dtd files it gives me an exception saying that the "dad"
: attribute is not allowed (which it should be according to the
: DTD).
: Also, why does the dump out of the DTD not include all of the
: declarations?
: The output is ====>
: Parsing [family.dtd]
: DTD ==>
: <!ELEMENT member ANY>
: <!ATTLIST member memberid ID >
: Switching validation on
: Parsing [family.xml]
: Exception [Illegal attribute name dad]
: The code is ====>
: import java.io.*;
: import java.util.*;
: import oracle.xml.parser.v2.*;
: import org.w3c.dom.*;
: public class XMLParserClient
: public static void main(String args[])
: try
: String xmlFileName = args[0];
: String dtdFileName = null;
: if(args.length > 1) dtdFileName = args[1];
: DOMParser domParser = new DOMParser();
: if(dtdFileName != null)
: // Parse the DTD from the file
: FileReader dtdReader = new
FileReader(dtdFileName);
: System.out.println("Parsing [" + dtdFileName +
: domParser.parseDTD( dtdReader, null);
: DTD dtd = domParser.getDoctype();
: // Dump out the DTD
: StringWriter dtdStringWriter = new
StringWriter();
: PrintWriter dtdPrintWriter = new PrintWriter
: (dtdStringWriter);
: dtd.printExternalDTD(dtdPrintWriter);
: String dtdString = dtdStringWriter.toString();
: System.out.println("DTD ==>");
: System.out.println(dtdString);
: // Switch on validation
: System.out.println("Switching validation on");
: domParser.setDoctype(dtd);
: domParser.setValidationMode(true);
: // Parse the XML from the file
: FileReader xmlReader = new FileReader(xmlFileName);
: System.out.println("Parsing [" + xmlFileName + "]");
: domParser.parse(xmlReader);
: System.out.println("Parsed OK");
: // Dump out the XML
: System.out.println("Generating XML");
: XMLDocument xmlDocument = domParser.getDocument();
: StringWriter stringWriter = new StringWriter();
: PrintWriter printWriter = new PrintWriter
: (stringWriter);
: xmlDocument.print(printWriter);
: String xmlString = stringWriter.toString();
: System.out.println("XML ==>");
: System.out.println(xmlString);
: catch(Exception exception)
: System.out.println("Exception [" + exception + "]");
A simple bug in our parser to fix in our upcoming release --
thanks. The sequence is:
1) Parse DTD file using DOMParser.parseDTD()
2) set validation to true
3) set DTD in the parser using setDocType()
4) Parse XML file using DOMParser.parse()
The DOMParser works in non-validating mode by default, and so
parseDTD() ignores most of the declarations; this is a bug,
however, since parseDTD() should always operate in validating
mode.
A workaround exists -- set validation to true explicitly before
calling parseDTD(), i.e., domParser.setValidationMode(true),
before calling parseDTD().
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
null

Similar Messages

  • Problems with Apache Commons Validator

    Hello there,
    I got a quiet big problem using the a.m. validation framework. When defining a validation rule for a property like this:
    <formset>
    <form name="testForm">
    <field property="firstName" depends="isEmail">
    <arg0 key="testForm.firstname"/>
    </field>
    </form>
    </formset>
    and instanciating my validator as follows:
    Validator validator = new Validator(resources, "testForm");
    validator.setParameter(Validator.BEAN_PARAM, name);
    everything works fine! I get a correct ValidatorResult object with a correct validation value.
    But as soons as I define a second Validation on the same property like this:
    <formset>
    <form name="testForm">
    <field property="firstName" depends="isEmail,isBlankOrNull">
    <arg0 key="testForm.firstname"/>
    </field>
    </form>
    </formset>
    Nothing works anymore. When iterating over the ValidatorResults object I only get one ValidatorResult object for "isEmail" with a wrong validation value. There should be two working ValidatorResult objects for "isEmail" and "isBlankOrNull"?!?!
    Are two validation method in the depends-Attribute not allowed (although it is defined in the standard)?
    You can assume, that the used validator class is conform to the given org.apache.commons.TestValidator!
    For any help, thx in advance!
    Greets
    CN

    Hey Aaron,
    Could you post your code for your <field>...</field>?
    Here is an example from: http://www.jsn-server3.com/struts-documentation/userGuide/dev_validator.html
    <field
        property="firstName" indexedListProperty="dependents"
        depends="requiredif">
      <arg0 key="dependentlistForm.firstName.label"/>
      <var>
        <var-name>field[0]</var-name>
        <var-value>lastName</var-value>
      </var>
      <var>
        <var-name>field-indexed[0]</var-name>
        <var-value>true</var-value>
      </var>
      <var>
        <var-name>field-test[0]</var-name>
        <var-value>NOTNULL</var-value>
      </var>
    </field>
    <field
        property="dob"
        indexedListProperty="dependents"
        depends="requiredif,date">
      <arg0 key="dependentlistForm.dob.label"/>
      <var>
        <var-name>field[0]</var-name>
        <var-value>lastName</var-value>
      </var>
      <var>
        <var-name>field-indexed[0]</var-name>
        <var-value>true</var-value>
      </var>
      <var>
        <var-name>field-test[0]</var-name>
        <var-value>NOTNULL</var-value>
      </var>
    </field>
    <field
        property="coverageType"
        indexedListProperty="dependents"
        depends="requiredif">
      <arg0 key="dependentlistForm.coverageType.label"/>
      <var>
        <var-name>field[0]</var-name>
        <var-value>lastName</var-value>
      </var>
      <var>
        <var-name>field-indexed[0]</var-name>
        <var-value>true</var-value>
      </var>
      <var>
        <var-name>field-test[0]</var-name>
        <var-value>NOTNULL</var-value>
      </var>
      <var>
        <var-name>field[1]</var-name>
        <var-value>insureDependents</var-value>
      </var>
      <var>
        <var-name>field-test[1]</var-name>
        <var-value>EQUAL</var-value>
      </var>
      <var>
        <var-name>field-value[1]</var-name>
        <var-value>true</var-value>
      </var>
      <var>
        <var-name>field-join</var-name>
        <var-value>AND</var-value>
      </var>
    </field>
    </form>" Which is read as follows: The firstName field is only required if the lastName field is non-null. Since field-indexed is true, it means that lastName must be a property of the same indexed field as firstName. Same thing for dob, except that we validate for date if not blank.
    The coverageType is only required if the lastName for the same indexed bean is not null, and also if the non-indexed field insureDependents is true.
    You can have an arbitrary number of fields by using the [n] syntax, the only restriction is that they must all be AND or OR, you can't mix. "
    Hope that helps,
    Nate

  • Problem with JPA + Hibernate Validator when performing update

    When I try to insert an new entity with a validation problem, Hibernate Validator works normally, but when I try to update an entity the InvalidStateException is not thrown when persist() is called, so when commit() is called a RollbackException is thrown.
    I'm using the latest versions of the hibernate libraries. The problem happened with JSF(NetBeans 6 VWP) and Java SE.
    Sample code:
          EntityManagerFactory emf = Persistence.createEntityManagerFactory("HibernateValidatorTest");        
          EntityManager em = emf.createEntityManager ();       
          ScfaqAssunto assunto = em.find(ScfaqAssunto.class, 2); // new ScfaqAssunto() works normally
          assunto.setAssunto(""); // the property assunto is with @NotEmpty              
          try
             em.getTransaction().begin();
             em.persist(assunto);
             em.getTransaction().commit();
          catch(InvalidStateException e)
             if( em.getTransaction().isActive())
                em.getTransaction().rollback();
             for(InvalidValue invalidValue : e.getInvalidValues())
                System.out.println (invalidValue.getMessage());
          catch(Exception e)
             if(em.getTransaction().isActive())
                em.getTransaction().rollback();
             System.out.println(e.getMessage());
          finally
             em.close();
          } Thanks for any help,
    Felipe

    Hi Thomas
    I loose hours with this problem
    there is a problem with toplink lib version
    just download toplink librairies at http://www.oracle.com/technology/products/ias/toplink/jpa/index.html
    replace oldest in $Glassfishdir\lib
    It have to works
    tested on postGres and Derby
    Can netbeans update center fix this problem?

  • Problems with B2B Editor validating HL7 Messages

    Hi all,
    I am having some problems related to B2B Document Editor and HL7 messages.
    When we ran the Analyzer with the following document:
    MSH|^~\&|ALERT|CHVNG|CPCHS|CHVNG|20070409145826+0000||OMG^O19^OMG_O19|1|P|2.4|
    PID|||303030^^^SONHO^NS||Patient^Alert||19840412000000+0000|M|||ESTRADA DA BARROCA, LOTE C O, FRT^^ENTRONCAMENTO^^2430|||||||^^^CHVNG|
    PV1||URG|1^33^^1||||||||||||||||27041729^^^CHVNG||||||||||||||||||||||||||||||||V|
    ORC|NW|100^ALERT|||||||20070409145813+0000|||123^Teste^M\XE9\dico^^^^^^^^^^ON|||||2000^RADIO TEXT^CHVNG|
    OBR||100^ALERT||M11020^Abd\XF3\men Simples Em P\XE9\^RADIO||||||||||||123^Teste^M\XE9\dico^^^^^^^^^^ON|
    NTE|||dor abdominal|
    we received the following message:
    "The data starting at position 510 is not a valid EDI interchange. The remainder of the data file was ignored. "
    It identifies the header (MSH Segment) well, but it can not identify the message body.
    It is very strange, because we've selected HL7 as the message format on the previous step but aparently this message is a EDI format message. This message occurs on any file we have or with any HL7 message found on the internet (http://www.dt7.com/cdc/sampmsgs.html)
    We can open the document with the Data Editor, but if we change any value and save it, it is impossible to open the message with the Analyzer:
    "The data in the file could not be parsed. Please check the file to verify that it is valid and formatted correctly. This error can occur for one of the following reasons: A) The data file may be a Word document or have some other binary format. B) The envelope data may not be formatted properly. If this is an X12 data file, please verify that the ISA segment is the correct size (exactly 106 characters). If this is an EDIFACT data file, it must have either a UNA or begin with UNB. For other standards, verify that the envelope segments conform to the specified rules. C) The segment/record delimiters in the file are incorrect."
    We are running the B2B Document Editor version 6.0.0.1471 with the 6.0.4.84 version of HL7 Database version.
    Can you give us any advice ?
    Cheers,
    Rodrigo Nascimento

    Hello,
    As per Jeff's post even we have observed OD OA at the end of the line. Please use a hex editor or B2B document editor to correct the same. We have done the above steps and are not getting the mentioned errors. HTH.
    Please let us know.
    Rgds,Ramesh

  • Is anyone having problems with the w3c validator killing Dreamweaver

    CS5.5 on win7 64bit is my system.
    If I try to validate a PHP page in live view, most times the validator works fine.
    If there is an error, and I click on the line number to find the error location, edit the file and close the validator window, I get a short fat barber's pole in blue and white on the bottom right of my screen, or sometimes a long thin one at the top right.
    The following message appears:
    >>>>>>>>>
    Server not found
    The page
    "http://localhost (path to page) was not loaded because Dreamweaver could not find the server "localhost". Please make sure that you are connected to the internet and the server name is correct.
    >>>>>>>>>
    On other occasions, the following  message appears after using the validator:
    >>>>>>>>>
    path to filename      The request to the W3C service has timed out. The service or your Internet connection appears to be down.
    My Internet connection is fine, and if I click on the w3c button again it validates with no problem.
    >>>>>>>>>
    When the first message appears, Dreamweaver becomes unstable and hangs, the only solution is to restart the program, after which everything works fine - including the validator, until it finds another error and the whole thing starts over again.
    CS5.5 on win7 64bit is my system.
    Is anyone else having problems like this with the validator?

    Try this: http://forums.adobe.com/message/2796075

  • Problem with JSF provided Validator

    Hi,
    I am running following code using Java Web Services Developers Pack 1.3. and it's giving me exception. Anybody has any insight to this problem? I appreciate your time and help.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <title>A Simple Java Server Faces Application</title>
    </head>
    <body>
    <f:use_faces>
    <h:form id="loginForm" formName="loginForm">
    <h3>Please enter your name and password.</h3>
    <table>
    <tr>
    <td>Name:</td>
    <td>
    <h:input_text id="username" valueRef="user.name"/>
                        <f:validate_required/>
                   </h:input_text>
    </td>
                   <td>
                   <h:output_errors for="username" color="red"/>
                   </td>
    </tr>
    <tr>
    <td>Password:</td>
    <td>
    <h:input_secret id="userpwd" valueRef="user.password"/>
                        <f:validate_required/>
                        <f:validate_length minimum="6"/>
                   </h:input_secret>
    </td>
                   <td>
                   <h:output_errors for="userpwd" color="red"/>
                   </td>
    </tr>
    </table>
    <p>
    <h:command_button label="Login" commandName="" action="login"/>
    </p>
    </h:form>
    </f:use_faces>
    </body>
    </html>
    Exception is as follows:
    exception
    java.lang.ClassCastException
         javax.faces.validator.RequiredValidator.validate(RequiredValidator.java:56)
         javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:998)
         javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:990)
         com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:85)
         com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:185)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:169)

    It sounds like you have not followed the instructions to replace the EA4 version of JavaServer Faces (bundled in JWSDP 1.3) with the beta release -- there is no such thing as javax.faces.validator.RequiredValidator any longer (this is done by different means now).
    http://java.sun.com/j2ee/javaserverfaces/docs/Installation.html
    Craig McClanahan

  • Problem With Removal of Validation/Substitution

    Hi all,
    We are currently adding a validation for Vendor Invoice Creation (FB60), however we are experiencing a runtime error.
    When we investigated the cause of the runtime error, it seems that there is a previous validation/substitution that was deleted using transaction OBBH, but the corresponding ABAP code was not removed.  Now, since the program and include where this code is located is standard, how can we remove that particular code please?
    We tried re-generating the substitution/validation code using program RGUGBR00 and RGUGBR01, but it seems it is not working.
    Thanks again in advance.

    Hi,
    Even I have the same problem.
    Even after deleting the substitution code is still exits .
    system generated code in Include GBTAKAMB have an syntax error which is giving short dumps.
    Any help is appreciated.
    Anyone used any SAP NOTE on this.
    TIA
    Rhea.
    Edited by: rhea on Jul 25, 2008 12:11 PM

  • Problem with ADF BC validation

    hi all,
    i have one EO and a vo based on it. I have created a validation rule. The EO has two attributes, min and max value. Min value should not be greater than max value. Therefore i have created a compare validator for this purpose. at run time, suppose i enter incorrect data, ie. 10 for max and 20 for min. Then the validation occurs and i get the error message. so at that point i tried to correct that data. when i put 5 for min value, error message still get fired. then the min value is set to 20 again. I have to again set it to 5 and save because the error is fired even after i correct incorrect data. How can i get rid of this? Pls help me.
    note that this work fine when i test the BC.

    sorry for not mentioning the jdev version. I am using Jdev 11.1.1.0.1
    But i have created the validation rule at Entity level(Not attribute level) i also tried attribute level, both compare validators and method validators. None of the options worked for this VO.
    Pls help me with this. Thanks alot

  • Problem with  regular expression  validation

    hi,
       how can i validate folder structure
       conditions
         no two  forward slashes(/) in a sequence no  special characters
        " /w" and   "  '/'  "    
       e:/tomcat/ss/ss.text
           if(valStr.matches("((['/'])[a-zA-Z0-9_]*)")){
                    System.out.println("matches");   
             else
                    System.out.println("notmatches");
    this is no correct .
    please give me right solution       
    with regards
    ss

    hI,
      /appmg/dd/
    is  the paths for solaris( starts with /)
    i have to test  if it is valid path name or not
    with regards
    ss

  • Problem with window of 'validation expression'

    Hello all,
    I have a very stupid problem and it stuck me since half an hour !!
    Indeed, i don't know how i did it but i move the window we use for creating our validation/Assignment rules (field validation expression) somewhere and i don't see it anymore. when i am clicking on the button '...', the window appears somewhere (can select it through the alt+TAB) but i cannot see it !!!!
    Is there a way to initialize this ? in order this window to come back at its standard size ???
    Thanks,
    JP

    Found the solution !!!
    For infos :
    Note 1277807 - Expression building window is not shown after launching.
    The Data Manager window for the expression builder is "missing" and is not visible after launching it.
    Solution
    It could be that the pop-up window that opens for the expression builder is "hidden" or if a two monitor set-up was used in the past it might not be visible.
    In order to find the missing window please try the following:
    1) Open an existing validation or create a new one then click on the
    three dots.
    2) Press Alt + Spacebar.
    3) Press the down arrow once and then Enter.
    4) Using the Left and Right arrow keys press one of them continuously in one direction and then the other to see if the missing dialog box will appear.
    Thanks all for your help
    Edited by: Jean-Philippe PAIN on Mar 3, 2010 4:49 PM

  • Problem with Client Side Validator - e.getFacesMessage is not a function

    (JDeveloper 11g, TP2 and TP3)
    I have created a custom validator that does server side validation as well as client side validation. It gets invoked - an alert is fired to prove that - but when validation fails, instead of the red box and error message that I was hoping for, I get a JavaScript error:
    e.getFacesMessage is not a function (all-11-otn2.js (line 27600))
    The getClientScript() method in the validator looks like this:
        public String getClientScript(FacesContext facesContext,
                                      UIComponent uIComponent) {
            return "function GreaterThanValidator(p1)\n" +
            "{  this.greaterThanItem=p1; \n" +
            "}\n" +
            "GreaterThanValidator.prototype.validate = function(value){" +
                           "alert('value= '+value); " +
            " if (!(value=='X')){ " +
            "    return new ValidatorException('Value must not be X '" +
            "         +' (current value = '+value+')');}"+
        }   Can someone tell me what I am doing wrong here? Like I said, the validation is performed, the alert is shown. Then when I raise the ValidatorException, the error occurs.
    thanks for any suggestions.
    Lucas
    Message was edited by:
    Lucas Jellema
    Message was edited by:
    Lucas Jellema
    Message was edited by:
    Lucas Jellema

    Lucas,
    I assume that this post is related to the previous
    Display client side validation error message with the pretty box
    I forwarded this internally and am waiting for a hint. Will update this post accordingly (or someone else will do directly)
    Frank

  • Problem with Car Registration Validation Code, Please Help !!

    Hi Folks,
    I'm trying to validate a vehicle registration which can either be in the format A100AAA or AA01AAA ( old and new style registrations ). I know there must be a better way of doing it than in my code as attached but I'm in dire need of enlightenment. Any help would be much appreciated. Cheers.
    if((( reg.charAt(0) >= 'A') && ( reg.charAt(0) <= 'Z' )) &&
               ((( reg.charAt(1) >= 0 ) && ( reg.charAt(1) <= 9 )) ||
               (( reg.charAt(1) >= 'A') && ( reg.charAt(1) <= 'Z' ))))
               (( reg.charAt(2) >= 0 ) && ( reg.charAt(2) <= 9 )))
               (( reg.charAt(3) >= 0 ) && ( reg.charAt(3) <= 9 )))
               (( reg.charAt(4) >= 'A' ) && ( reg.charAt(4) <= 'Z' )) &&
               (( reg.charAt(5) >= 'A' ) && ( reg.charAt(5) <= 'Z' )) &&
               (( reg.charAt(6) >= 'A' ) && ( reg.charAt(6) <= 'Z' )))
               System.out.println("Registration Validation Complete");
               else
               throw new InvalidRecord("Invalid Registration. Please enter " +
                                    "a valid Vehicle Registration");

    Regular expressions -
    import java.util.regex.*;
    public class Fred400
        public static void main(String[] args)
            Pattern numberPlatePattern = Pattern.compile("[A-Z][0-9]{3}[A-Z]{3}|[A-Z]{2}[0-9]{2}[A-Z]{3}");
                Matcher m = numberPlatePattern.matcher("A100AAA");
                System.out.println(m.matches());
                Matcher m = numberPlatePattern.matcher("AA01AAA");
                System.out.println(m.matches());
                // Should fail
                Matcher m = numberPlatePattern.matcher("AA01AAA1");
                System.out.println(m.matches());
    }

  • Problems with XMLparser

    I've got the following code (extracted from steven Muench his book!)
    query := 'select id from pts_executors order by id';
    xmlgen.clearBindValues;
    -- (1) Create the stylesheet from TechnicalPaper.xsl loaded by
    -- name from the xml_documents table.
    style := xmldoc.get( 'test' );
    stylesheet := xslt.stylesheet( style );
    (code snipped)
    step with style := .. is working. the xmldoc.get gets the document nicely and its filled.
    as soon as stylesheet := xslt.stylesheet( style) is called an exception is thrown
    ORA-20103: Null input is not allowed.
    What is going wrong here?!
    TIA
    Martin

    I've got the following code (extracted from steven Muench his book!)
    query := 'select id from pts_executors order by id';
    xmlgen.clearBindValues;
    -- (1) Create the stylesheet from TechnicalPaper.xsl loaded by
    -- name from the xml_documents table.
    style := xmldoc.get( 'test' );
    stylesheet := xslt.stylesheet( style );
    (code snipped)
    step with style := .. is working. the xmldoc.get gets the document nicely and its filled.
    as soon as stylesheet := xslt.stylesheet( style) is called an exception is thrown
    ORA-20103: Null input is not allowed.
    What is going wrong here?!
    TIA
    Martin

  • 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.

  • Problem with several occurence of same ToolTip

    For a test form, I am using Dreamweaver CS4 Spry Tooltip Widgets. In this form, I need to have several occurence of a same Tooltip. All works fine. But there is a problem with the W3C validator, which returns the error: id "sprytrigger2" already defined. Any help to help me on that
    problem is welcome. Many thanks.
    Part of the HTML code (below)
    <img src="button.gif" ... id="sprytrigger1">
    <img src="button.gif" ... id="sprytrigger2">
    <img src="button.gif" ... id="sprytrigger2">
    <div class="tooltipContent" id="sprytooltip1">--- GOOD---</div>
    <div class="tooltipContent" id="sprytooltip2">--- You are Wrong ---</div>
    <script type="text/javascript">
    <!--
    var sprytooltip1 = new Spry.Widget.Tooltip("sprytooltip1", "#sprytrigger1");
    var sprytooltip2 = new Spry.Widget.Tooltip("sprytooltip2", "#sprytrigger2");
    //-->
    </script>
    W3C Validator Error code returned:
    id "sprytrigger2" already defined
    An "id" is a unique identifier. Each time this attribute is used in a document it must have a different value. If you are using this
    attribute as a hook for style sheets it may be more appropriate to use classes (which group elements) than id (which are used to identify
    exactly one element).

    If you are using true ToolTips, you have a different location for each on your page.
    I would not personally worry about the additional variables adding much to your code.
    But if you are concerned, and the messages are really all the same, you could do a show/hide and use an absolute positioning:
    .ivorycrunch_pu
         position:absolute;
         border: #5b0085 2px solid;
         right: 50px;
         top: 50px;
         width:300px;
         height:300px;
         z-index:1000;
         visibility: hidden;
    This particular one is set up to show a background image...a different one for each item (coded in a separate rule)...
    <div class="ivorycrunch_pu">
         <h5><a onclick="MM_showHideLayers('ivorycrunch_pu','','hide')">close</a></h5>
    </div>
    But if you changed this to class="Okay" and altered the style to suit, remembering to make an item with an id of 'Okay' somewhere on your page, this should work, too. Play around with it. I did not customize this for your purpose. Note that I have a 'close' text link. You would put your text in this div, not necessarily as a link, but you would need a link to close it. I think you will need to add this as a behavior, so you get the appropriate javascript on your page.
    I didn't work with this long enough to suit your uses, but you should be able to jimmie around with it to make it work. Because the position is set in relation to the div of the 'trigger' text, you might need to have each 'trigger' in its own div.
    Personally, I would go the ToolTip route and let Dreamweaver do my positioning for me.
    Beth
    You might create one ToolTip and then set it up to use a class instead of an ID. Don't know if that would work. B

Maybe you are looking for

  • How do you choose the scratch disk in lightroom 5.5

    how do you choose the scratch disk in lightroom 5.5

  • The biggest annoying drawback of ZEN Nano P

    I'm very disappointed after few months of using ZEN Nano Plus player. is that it don't display artist from ID3 tag, but only title from each track. I'm sure that this bug, is not a such big problem to fix in the firmware by the Creative Developers. B

  • Passing parameters to RFC enabled FM

    Hi, I have following data defined.. DATA: BEGIN OF *aaa OCCURS 0,           END OF *aaa. I want to call an RFC enabled FM in another system and pass this data. Also I want to receive lots of such internal table data (*bbb, *ccc, *ddd )in return from

  • JcomboBox How display names, but return ids?

    I am implemeting a combobox from a table (id, name). I want display the names, but when the user select a item, I want to get the id corresponding to the name selected How i make this?

  • MMR Creation

    Gurus, Whenever a MMR is created,the system should send a msg to particular person.Is this possible.