How to validate an xml with a schema w/o specifying the schema in the xml

I have done xml validation with xml schemas, where the xml points to the xsd to use. However, I would like to not have to specifiy the xml schema in the xml document (and can't ensure that the xml coming to us has that in it). How do I, in the java code, tell it what schema to use in validation?
Brian

static final String schemaSource = argv[0];
static final String JAXP_SCHEMA_SOURCE =
"http://java.sun.com/xml/jaxp/properties/schemaSource";
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
factory.setAttribute(JAXP_SCHEMA_SOURCE,
new File(schemaSource));

Similar Messages

  • How to validate an XML with its XSD in jdk1.4.2_09?

    Hi all,
    Kindly Tell me how to validate an Xml against an XSD in JDK1.4.2_09....
    I was able to do it in jdk1.5 using the Validation class available in java.xml.validation package...
    But the Task for me is to do in jdk1.4.2 since my application server runs on jdk1.4.2... changin to jdk1.5 will result in failure of main application...
    sample code will be useful...
    thanks in advance.
    Regards,
    Sundararamaprasad.

    HI,
    Thanks for the suggestion.... The Thing is when i compiled and executre my code it really got execute well when i ran it in the Command Prompt after settiongup appropriate classpath and path... but when i executed the same thing in the server it did not get executed though the application server also run on top of the same JDk.....I've check it out..anyhow the link gave me a very good learning...Thanks for the valuable suggestion..... :)
    Regards,
    Sundararamaprasad.

  • How do i find ITunes with windows 8. i went to the website to download itunes and it says thank you for downloading but i can not find it in my computer

    I have gone to itunes and downloaded it for my computer. My computer runs windows 8. the web site tells me thank you for downloading but my computer doesnt not have it nor can i locate it. it didnt even ask for my permission like it does with everything else that i download. Question is how to I get it with windows

    Try downloading an installer from the Apple website using a different web browser:
    http://www.apple.com/itunes/download/
    If you use Firefox instead of IE for the download (or vice versa), do you get a working installer?

  • Im switching email accounts on my itunes account am the computer isnt recognizing purchases made from my other account on the new one (apps). How can I sign in with my new account and get the purchases apps on both accounts?

    Im switching email accounts on my itunes account am the computer isnt recognizing purchases made from my other account on the new one (apps). How can I sign in with my new account and get the purchases apps on both accounts?

    This was EXACTLY what I needed about the purchases I made from my device. However, is there a way to re-download other ones you've made from a computer? Because I realized some of them were not just purchased from my device.
    This is a picture of what it looks like now:
    http://tinypic.com/r/107quxu/7
    As you can see, the stuff circled in red doesn't give me an option to download from Cloud Beta because it already says "downloaded".
    any way to get around that?

  • How to validate an XML file with XSD Schema on JDK 1.4

    Hi
    I'm looking for samples how to validate xml files with xsd schema using jsdk 1.4
    Thank you.

    This is how.
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.dom.DOMResult;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.validation.Schema;
    import javax.xml.validation.SchemaFactory;
    import javax.xml.validation.Validator;
    DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
    dbfac.setNamespaceAware(true);
    SchemaFactory factory1 = SchemaFactory
                        .newInstance("http://www.w3.org/2001/XMLSchema");
    Schema schema = factory1.newSchema(new File("person.xsd"));
    dbfac.setSchema(schema);
    DocumentBuilder dbparser1 = dbfac.newDocumentBuilder();
    Document doc1 = dbparser1.parse(new File("person.xml"));
    Validator validator1 = schema.newValidator();
    DOMSource dm1 = new DOMSource(doc1);
    DOMResult domresult1 = new DOMResult();
    validator1.validate(dm1, domresult1);

  • How to validate EDI XML payload against ECS file

    Hi All,
    How to validate an EDI XML against ecs file.
    Can you please provide steps.
    Sample EDI XML i am trying to validate against EDI_4010_850.ecs
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <Transaction-850 xmlns:ns1="urn:oracle:b2b:X12/V4010/850" Standard="X12" xmlns="urn:oracle:b2b:X12/V4010/850">
    <ns1:Segment-ST>
    <ns1:Element-143>850</ns1:Element-143>
    <ns1:Element-329>000000010</ns1:Element-329>
    </ns1:Segment-ST>
    <ns1:Segment-BEG>
    <ns1:Element-353>00</ns1:Element-353>
    <ns1:Element-92>NE</ns1:Element-92>
    <ns1:Element-324>12345678</ns1:Element-324>
    <ns1:Element-373>20140703</ns1:Element-373>
    </ns1:Segment-BEG>
    <ns1:Loop-PO1>
    <ns1:Segment-PO1>
    <ns1:Element-350>001</ns1:Element-350>
    <ns1:Element-330>1</ns1:Element-330>
    <ns1:Element-212>96</ns1:Element-212>
    <ns1:Element-639>AA</ns1:Element-639>
    <ns1:Element-235_1>VC</ns1:Element-235_1>
    <ns1:Element-234_1>571157</ns1:Element-234_1>
    <ns1:Element-235_2>CB</ns1:Element-235_2>
    <ns1:Element-234_2>00100</ns1:Element-234_2>
    </ns1:Segment-PO1>
    <ns1:Loop-PID>
    <ns1:Segment-PID>
    <ns1:Element-349>F</ns1:Element-349>
    <ns1:Element-352>Rockford product</ns1:Element-352>
    </ns1:Segment-PID>
    </ns1:Loop-PID>
    <ns1:Segment-DTM>
    <ns1:Element-374>038</ns1:Element-374>
    <ns1:Element-373>20140626</ns1:Element-373>
    </ns1:Segment-DTM>
    <ns1:Loop-AMT>
    <ns1:Segment-AMT>
    <ns1:Element-522>1</ns1:Element-522>
    <ns1:Element-782>1</ns1:Element-782>
    </ns1:Segment-AMT></ns1:Loop-AMT>
    </ns1:Loop-PO1>
    <ns1:Segment-SE>
    <ns1:Element-96>#SegmentCount#</ns1:Element-96>
    <ns1:Element-329>000000010</ns1:Element-329>
    </ns1:Segment-SE>
    </Transaction-850>
    Thanks,
    Sid.

    What We have done is, took the XML which we are passing to B2B and assigned the XSD_PO_850 schema to it and validated. Its showing as Valid. Not sure, where the issue is now?

  • How to validate inserted xml data in oracle is correct or not

    (i.e.how to validate xml syntax and tags are correct)
    XML data has been inserted in Oracle database.Once inserted
    I want to validate that data entered and tags inserted are correct
    or not.
    Pl help

    Some small remarks after a life time of write that small notepad.
    Don't use XMLIsValid() - Apperently it was once ment for use in table constraints only AND the most annoying part, it doesn't give you a proper error message.
    More usable is schemaValidate() - it throws a useful error message... I never came around to update that post or write a proper one while using schemaValidate().
    I would be against advising / using a Java wrapper to achieve this goal unless you are on a pre 9.2 database version. Registering, validation and such is optimized (in memory) in Oracle from the beginning in 9.2.0.3 and onwards to avoid for instance reparsing of the XML Schema itself. If a XML Schema is registered a lot is optimized including DOM, which will be avoided and "outsmarted" by using XOB objects (see the Oracle manuals only a few hits and those will point you directly to the optimizations at hand).

  • How to validate an XML file in BPEL ?

    Hi All,
    I have 2 Bpel processes.
    One for creating supplier and one for formate Validations.
    I am having problems with formate Validations.
    I am trying to validate an xml file that is passed to my Bpel Process (SupplierValidation).
    My process contains the following:
    I have a client which its property Name is set to ValidateXML and its value set to true.
    I have a recieve activity and a reply out !
    very simple process, but its working !
    This process is synchronous.
    Help is needed !
    Thanks,
    aj

    you have to use bpelx:validate as sown below
    <bpelx:validate variables="inputVariable" name="ValidateInputXML"/>

  • How to validate PDF document with JAVA

    Hi,
    Is there any way to write JAVA app that will validate PDFs through/with LC API ? I was traying with code:
    ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
    FormsServiceClient formsClient = new FormsServiceClient(myFactory);
    FormsResult renderedForm = renderPDF(formName, xmlData, url, formsClient);        
    RenderOptionsSpec processSpec = new RenderOptionsSpec();
    //processSpec.setValidationReporting(5);
    processSpec.setLocale("pl_PL");
    FormsResult formOut = formsClient.processFormSubmission(renderedForm.getOutputContent(),"CONTENT_TYPE=applicati on/pdf","",processSpec);
    System.out.println(formOut.getValidationErrorsList().toString());
    //Rendering method
    private static FormsResult renderPDF(String formName,String  xmlData, String url, FormsServiceClient formsClient) throws RenderFormException, DSCException, UnsupportedEncodingException {
             PDFFormRenderSpec pdfFormRenderSpec = new PDFFormRenderSpec();
             pdfFormRenderSpec.setCacheEnabled(new Boolean(false));
             pdfFormRenderSpec.setXMLData(true);
             pdfFormRenderSpec.setStandAlone(true);
             pdfFormRenderSpec.setLinearizedPDF(true);
             URLSpec urlSpec = new URLSpec();
             urlSpec.setContentRootURI(url);
             String credentialAlias = CREDENTIAL_ALIAS;
             String credentialPassword = CREDENTIAL_PASSWORD;
             ReaderExtensionSpec reOptions = new ReaderExtensionSpec();
             reOptions.setReCredentialAlias(credentialAlias);
             reOptions.setReCredentialPassword(credentialPassword);
             reOptions.setReExpImp(true);
             reOptions.setReFillIn(true);
             reOptions.setReDigSig(true);
             Document inputData = new Document(xmlData.getBytes("UTF-8"));
             /*return renderedForm = formsClient.renderPDFForm(formName,inputData,pdfFormRenderSpec,urlSpec,null);*/
             return formsClient.renderPDFFormWithUsageRights(formName,inputData,pdfFormRenderSpec,reOptions,u rlSpec);
    but in formOut.getValidationErrorsList() i still get:
    [8/2/10 12:03:46:728 GMT+01:00] 0000002c SystemOut     O --------------------Validation------------
    [8/2/10 12:03:46:728 GMT+01:00] 0000002c SystemOut     O <document state="active" senderVersion="3" persistent="false" senderPersistent="false" passivated="false" senderPassivated="false" deserialized="true" senderHostId="127.0.0.1/172.16.133.24/172.16.134.24" callbackId="0" senderCallbackId="0" callbackRef="null" isLocalizable="false" isTransactionBound="false" defaultDisposalTimeout="600" disposalTimeout="600" maxInlineSize="65536" defaultMaxInlineSize="65536" inlineSize="0" contentType="null" length="-1"><cacheId/><localBackendId/><globalBackendId/><senderLocalBackendId/><senderGl obalBackendId/><inline></inline><senderPullServantJndiName>adobe/idp/DocumentPullServant/a dobews_anathNode01Cell_anathNode02_server1</senderPullServantJndiName><attributes/></docum ent>
    without any errors. I was looking around (google,forum and Adobe Develop Connection) but no luck . Is it posible to make it that way ?
    Ps.
    It's my first post so (if i did something wrong ) be gentle. And ... sorry for my poor english .

    I modified code for rendering form and for validating and I start to get erros on output, but that is not complete list
    <document state="active" senderVersion="3" persistent="false" senderPersistent="false" passivated="false" senderPassivated="false"
    deserialized="true" senderHostId="127.0.0.1/172.16.133.24/172.16.134.24" callbackId="0" senderCallbackId="0" callbackRef="null"
    isLocalizable="false" isTransactionBound="false" defaultDisposalTimeout="600" disposalTimeout="600" maxInlineSize="65536"
    defaultMaxInlineSize="65536" inlineSize="342" contentType="text/xml" length="-1">
    <cacheId/>
    <localBackendId/>
    <globalBackendId/>
    <senderLocalBackendId/>
    <senderGlobalBackendId/>
    <inline>
        <?xml version="1.0" encoding="UTF-8"?>
        <validationErrors>
        <m d="2010-08-04T10:05:48.897+02:00" ref="...
    </inline>
    <senderPullServantJndiName>adobe/idp/DocumentPullServant/adobews_anathNode01Cell_anathNode 02_server1</senderPullServantJndiName>
    <attributes/>
    </document>
    it is cut in place where should be reference to wrong field.
    <inline>
         <?xml version="1.0" encoding="UTF-8"?>
         <validationErrors>
         <m d="2010-08-04T10:05:48.897+02:00" ref="...
    </inline>
    I attach whole class after changes:
    public class AdobeForm {
        private static final String CREDENTIAL_ALIAS  = "READER_EXC_CERT";
        private static final String IIOP = "iiop://localhost:2810";
        private static final String CREDENTIAL_PASSWORD = "pass";
        private static final String AS_USERNAME = "log";
        private static final String AS_PASSWORD = "pass";
        private static final String NO_ERRORS = "";
        public static byte[] renderForm(String formName,String  xmlData, String url){
            byte[] data = null;
            try
                //JBOSS
    /*            Properties connectionProps = new Properties();
                connectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", "jnp://localhost:1099");
                connectionProps.setProperty("DSC_TRANSPORT_PROTOCOL", "EJB");
                connectionProps.setProperty("DSC_SERVER_TYPE", "JBoss");
                connectionProps.setProperty("DSC_CREDENTIAL_USERNAME", "log");
                connectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", "pass");*/
               // dla WebSphere
                Properties connectionProps = new Properties();
                connectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", IIOP);
                connectionProps.setProperty("DSC_TRANSPORT_PROTOCOL","EJB");         
                connectionProps.setProperty("DSC_SERVER_TYPE", "WebSphere");
                connectionProps.setProperty("DSC_CREDENTIAL_USERNAME", AS_USERNAME);
                connectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", AS_PASSWORD);
                ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
                FormsServiceClient formsClient = new FormsServiceClient(myFactory);
                FormsResult renderedForm = renderPDF(formName, xmlData, url, formsClient, false);
                //test(renderedForm);
                Document renderedFormData = renderedForm.getOutputContent();
                InputStream inputStream = renderedFormData.getInputStream();
                // to pewnie trzeba poprawic na przepisywanie duzych danych
                int size = inputStream.available();
                data = new byte[size];
                inputStream.read(data);
                inputStream.close();
            catch (Exception e)
                e.printStackTrace();
            return data;
        public static byte[] validateForm(String formName, String xmlData, String url){
            byte[] data = null;
            try
                //JBOSS
                Properties connectionProps = new Properties();
                connectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", "jnp://localhost:1099");
                connectionProps.setProperty("DSC_TRANSPORT_PROTOCOL", "EJB");
                connectionProps.setProperty("DSC_SERVER_TYPE", "JBoss");
                connectionProps.setProperty("DSC_CREDENTIAL_USERNAME", "administrator");
                connectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", "password");*/
                // dla WebSphere
                Properties connectionProps = new Properties();
                connectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", IIOP);
                connectionProps.setProperty("DSC_TRANSPORT_PROTOCOL","EJB");         
                connectionProps.setProperty("DSC_SERVER_TYPE", "WebSphere");
                connectionProps.setProperty("DSC_CREDENTIAL_USERNAME", AS_USERNAME);
                connectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", AS_PASSWORD);
                ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
                FormsServiceClient formsClient = new FormsServiceClient(myFactory);
                FormsResult renderedForm = renderPDF(formName, xmlData, url, formsClient, true);        
                RenderOptionsSpec processSpec = new RenderOptionsSpec();
                processSpec.setValidationUI(0);
                processSpec.setValidationReporting(10);
                processSpec.setCacheEnabled(true);
                //processSpec.setXMLData(true);
                //processSpec.setDebugEnabled(true);
                /*processSpec.setLocale("pl_PL");
                processSpec.setStandAlone(true);*/
                FormsResult formOut = formsClient.processFormSubmission(renderedForm.getXMLData(),
                        "I=application/pdf&CONTENT_TYPE=application/vnd.adobe.xdp+xml",
                        "",processSpec);
    /*            Document inputData = new Document(xmlData.getBytes("UTF-8"));
                FormsResult formOut = formsClient.processFormSubmission(inputData,
                        "CONTENT_TYPE=application/pdf&CONTENT_TYPE=application/vnd.adobe.xdp+xml&CONTENT_TYPE=tex t/xml",
                        "",processSpec);*/
                test(formOut);
                // to pewnie trzeba poprawic na przepisywanie duzych danych
                InputStream inputStream = formOut.getOutputContent().getInputStream();
                int size = inputStream.available();
                data = new byte[size];
                inputStream.read(data);
                inputStream.close();
                System.out.println("Dane: "+(new String(data)));
                System.out.println("------------------------------------------");
                System.out.println("OutputXML: "+formOut.getOutputXML());
                return NO_ERRORS.getBytes();
            catch (Exception e)
                e.printStackTrace();
            return NO_ERRORS.getBytes();
        private static void test(FormsResult formOut) {
            if(formOut != null)
                System.out.println("------------------------------------------");
                System.out.println("--------------------Validation------------");
                System.out.println(formOut.getValidationErrorsList());
                System.out.println("------------------------------------------");
                System.out.println("------------------------------------------");   
            else
                System.out.println("-------------------FORMOUT NULL-----------------------");   
        @SuppressWarnings("unused")
        private static void showData(String xmlData, String formName, String url) {
            System.out.println("------------------XML------------------------");
            System.out.println("XML: "+xmlData);
            System.out.println("Form: "+formName);
            System.out.println("URL: "+url);
            System.out.println("------------------XML------------------------");
        private static FormsResult renderPDF(String formName,String  xmlData, String url, FormsServiceClient formsClient, boolean renderedForm) throws RenderFormException, DSCException, UnsupportedEncodingException {
             URLSpec urlSpec = new URLSpec();
             urlSpec.setContentRootURI(url);
             PDFFormRenderSpec pdfFormRenderSpec = new PDFFormRenderSpec();
             pdfFormRenderSpec.setCacheEnabled(true);
             pdfFormRenderSpec.setXMLData(true);
    /*       pdfFormRenderSpec.setDebugEnabled(true);
             pdfFormRenderSpec.setLocale("pl_PL");
             //without rights
             if(renderedForm)//see bellow
                 pdfFormRenderSpec.setLinearizedPDF(true); */
             System.out.println("RenderServlet formName "+formName);  
             String credentialAlias = CREDENTIAL_ALIAS;
             String credentialPassword = CREDENTIAL_PASSWORD;
             Document inputData = new Document(xmlData.getBytes("UTF-8"));
             if(renderedForm)
                 return formsClient.renderPDFForm(formName,inputData,pdfFormRenderSpec,urlSpec,null);
             else
                 ReaderExtensionSpec reOptions = new ReaderExtensionSpec();
                 reOptions.setReCredentialAlias(credentialAlias);
                 reOptions.setReCredentialPassword(credentialPassword);
                 reOptions.setReExpImp(true);
                 reOptions.setReFillIn(true);
                 reOptions.setReDigSig(true);
                 pdfFormRenderSpec.setStandAlone(true);
                 return formsClient.renderPDFFormWithUsageRights(formName,inputData,pdfFormRenderSpec,reOptions,u rlSpec);
             //[8/4/10 11:10:55:928 GMT+01:00] 0000002a CommonGibsonU W com.adobe.livecycle.formsservice.logging.FormsLogger logMessage ALC-FRM-001-048: Forms with Rights cannot be linearized.

  • How to connect to database with a schema other than current user?

    Dear all,
    I would like to know whether it is possible to specify a specific schema while connecting to a database directly by SQL*Plus command. Usually here is what I do (assuming that db01.WORLD is already in tnsnames.ora)
    $ sqlplus scott/[email protected], in this case the user is SCOTT and the current schema is also SCOTT. If I want to change the current schema I have to use an ALTER SESSION SET CURRENT_SCHEMA command. So what I would like to know is that whether there is an alternative, that is, proceeding in a way where the user SCOTT connects directly (by using SQL*Plus shell) to a SCHEMA other than SCOTT (in other words, is it possible to specify the desired schema at the connection time, for example user SCOTT who connects under a schema named 'management')
    Thanks in advance,
    Dariyoosh

    The ordinary way to do this is to
    1 - grant object privileges from the other schema to scott (Refer to the GRANT command in the online documentation)
    2 - create a private synonym in the Scott user (Look up CREATE SYNONYM in the documentation)
    The only other solution would be to make sure to create an after login trigger running the alter session command.
    Finally two words of advise
    1 You are recommended to leave the user Scott alone, and not mess it up with your own additions.
    2 You seem to treat this forum as a free Oracle class. As the people responding here are volunteers you are kindly advised to stop doing that and use the online documentation at http://tahiti.oracle.com and read at least the 'Getting Started' document and/or the '2-Day' document for your unknown version of Oracle.
    Sybrand Bakker
    Senior Oracle DBA

  • HT2486 My address book only displays e-mails. How can I sync it with my i-phone to display the address book the same way as my contacts in my i-phone?

    Currently my address book only displays e-mail addresses. It uses the portion of the address in front of the @ as the name. How can I sync it with my i-phone 4S that has name/numbers and addresses of my contacts?

    Hello there, Seta.
    You are correct that this can be done with iCloud. The following Knowledge Base article provides some great instruction for syncing contacts:
    iOS: How to transfer or sync content to your computer
    http://support.apple.com/kb/ht1296
    Particularly:
    Contacts, Calendars, Bookmarks, and Notes
    You can sync contacts, calendars, bookmarks, and notes with other applications on your computer. This allows you to keep all your information in sync across multiple computers and iOS devices. The settings for these items are all in the Info tab for your iOS device in iTunes. With your iOS device connected to the computer, select your iOS device. Then click the Info tab.
    For details on syncing content on your iOS device with your computer, click the sections below.
    Contacts
    To sync contacts with your computer, choose "Sync Contacts with" within iTunes for Windows, or "Sync Contacts" in OS X v10.8, or "Sync Address Book Contacts" in OS X v10.7 and earlier.
    You can sync your contacts with:
    Microsoft Outlook 2003, Microsoft Outlook 2007, Microsoft Outlook 2010 (Windows XP, Windows Vista, Windows 7, and Windows 8)
    Windows Address Book (Windows XP)
    Windows Contacts (Windows Vista, Windows 7, and Windows 8)
    Address Book (Mac OS X v10.7 and earlier)
    Contacts (Mac OS X v10.8)
    Microsoft Entourage 2004, Microsoft Entourage 2008, or Microsoft Outlook 2011 for Mac
    Notes:
    When syncing contacts, you can choose to sync all of your contacts or only selected groups. The option to sync selected items may not show up until after the first sync.
    You can select a group of contacts to which all new contacts created on your iOS device will be added.
    Additional options for syncing include syncing your contacts with Yahoo or Gmail/Google Mail. You will need to configure it with the user name and password for your Yahoo or Google account.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • How to set up facetime with iPad and MacPro that have the same Apple ID?

    I have a iPad and a MacPro both with the same Apple ID but they are different locations. I am using the iPad in NY and my husband is using the MacPro in a different location. I cannot call him on the MacPro with facetime. When I call the message says "....not available"

    Hello Susan Dietz,
    Much like calling from one phone to another, you would need a separate Apple ID to contact with FaceTime (just as calling your own phone number would direct you to your own voicemail, rather than ring your phone).
    iOS: Using FaceTime
    http://support.apple.com/kb/HT4319
    Create an Apple ID.
    https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/wa/createAppleId?loca lang=en_US
    Cheers,
    Allen

  • How do I count parts with a fiber optic sensor using the NI-1772 and VBAI 2011?

    I'm inspecting parts using the NI-1772.  Just after the camera, bad parts are ejected when they pass by a fiberoptic sensor.  I want to use another sensor after that to verify the number of good parts, so that I can be sure the bad parts have been ejected? 
    I've tried using the READ/WRITE I/O step to read falling edges in sequence with a calculator step to increment the counts for each inspection iteration.  I get a few counts at start up, and then the counts stop.  It's as if the inspection has looped back to the Acquire Image step before or after the cap is present at the sensor.  
    Once this is figured out, I want to reset the count when a preset is reached.  
    Thanks,
    Rob

    Hi Brad,
    It seems that the ISO Input is reading all of the falling and rising edges based on the LED, and that the Read/Write I/O step counts all of the falling edges when in configuration mode.  I believe the signal stays low for about 10ms. (It might be important to clarify that I'm not using the camera trigger input for this.  It is a subsequent sensor downstream of the camera.)  I've attempted to attach a section of my inspection. 
    Thanks,
    Rob
    Attachments:
    Section of RS38_3JAN13.vbai ‏96 KB

  • How to validate generated XML-Document in Memory by XML-Schema?

    Hi all!
    I have the following problem:
    I am generating a Document using the DOM delivered with Xerces 2.6.2.
    Before I'll send the generated xml-document through network to another system I have to check with my xml-schema if the document is correct.
    In the DOM-FAQ I found an "example" trying to explain how it should work. But with this example the problems begin.
    I am creating my document with this method:
         public void createDocument() {
              myDOM = DOMImplementationImpl.getDOMImplementation();
              doc = myDOM.createDocument("", "documentData", null);
              root = doc.getDocumentElement();
              root.setAttribute(
                   "xmlns:xsi",
                   "http://www.w3.org/2001/XMLSchema-instance");
              //          root.setAttribute("xsi:noNamespaceSchemaLocation", "myScheme.xsd");
              domConfig = ((DocumentImpl) doc).getDomConfig();
              domConfig.setParameter(
                   "schema-location",
                   "file:///d:/workspace/XMLProject/WebContent/WEB-INF/myScheme.xsd");
              domConfig.setParameter("error-handler", new EHandler());
              domConfig.setParameter("validate", Boolean.TRUE);
         }In the line getting the domConfig, it is getting differeing to the example: The example is like this:
    import org.w3c.dom.Document;
    import org.w3c.dom.DOMConfiguration;
    import org.w3c.dom.ls.LSParser;
    Document document = builder.parseURI("data/personal-schema.xml");
    DOMConfiguration config = document.getConfig();
    config.setParameter("error-handler",new MyErrorHandler());
    config.setParameter("validate", Boolean.TRUE);
    document.normalizeDocument();They get the DOM-Configuration from the document-Object, but my document-Object has no "getConfig()" and only after type-casting I get a getDomConfig()-Method to get the configuration.
    Then I fill my document and call                
    ((DocumentImpl) doc).normalizeDocument();When I run my Application I get the following error:
    org.w3c.dom.DOMException: FEATURE_NOT_SUPPORTED: The parameter schema-location is recognized but the requested value cannot be set.
         at org.apache.xerces.dom.DOMConfigurationImpl.setParameter(Unknown Source)
         at xmlProject.createDocument(Convert.java:63)
         at xmlProject.Convert.main(Convert.java:154)I tried several ways to get the validation without success.
    The next question is how I should refer to my xml-schema (which path) and where to place it relative to my jar I will generate, because I will have no webserver I could place it on.
    Has anyone any experience with validating a document created and not placed on disc?
    I have also another question to SAX: I read, that it is reading a document without saving it in the memory. I think this means that if I am validating it by SAX it will be read once and for parsing it will be read a second time. If I would transfer the document over an tcp-connection, I only have the document once in my inputstream and after validation it would be consumed I think. But what can I parse then? Or did I missed a detail with the function of the SAX?
    Thank you for your help!
    Yours
    Christian

    static final String schemaSource = argv[0];
    static final String JAXP_SCHEMA_SOURCE =
    "http://java.sun.com/xml/jaxp/properties/schemaSource";
    DocumentBuilderFactory factory =
    DocumentBuilderFactory.newInstance();
    factory.setAttribute(JAXP_SCHEMA_SOURCE,
    new File(schemaSource));

  • How to validate a date with time

    Hi All,
    How can I validate date with time?
    Here is my code:
    var tempDate:Date = new Date();
    if (tempDate < '09/18/2012 7:30:00 AM'){
         doSomething
    Thanks in advanced

    I think i got it to work.
    var tempDate:Date = new Date();
    var oldDate:Date = new Date('09/18/2012 7:30:00 AM');
    if ( Number(tempDate) < Number(oldDate) ){
         doSomething
    Best,

Maybe you are looking for