Results 1 to 6 of 6

Thread: XML Validation

  1. #1
    sehudson's Avatar
    sehudson is offline Senior Member
    Join Date
    Mar 2010
    Posts
    357
    Rep Power
    5

    Default XML Validation

    I am trying to validate the data passed into a form, by using an xml validator, I have:

    Java Code:
    <field property="box1.entered" depends="validwhen">
    <msg name="validwhen" key="error.25"/>
    <var>
    <var-name>test</var-name>
    <var-value>
    textBox2.value.length !=6 
       </var-value>
     </var>
    </field>
    I keep getting 'unexpected Token: textbox2.value.length'

    How can I reference the length of the text that is inside the textbox2 in this XML?

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,185
    Rep Power
    20

    Default

    That entirely depends on the system that this XML is designed to work with. That is, we have no idea what this XML represents or what framework it is for or anything.

    Have you read the documentation for whatever validation thing you;re using?

  3. #3
    Jodokus's Avatar
    Jodokus is offline Senior Member
    Join Date
    Jan 2011
    Location
    Amsterdam, the Netherlands
    Posts
    230
    Rep Power
    4

    Default

    Your snippet is well-formed XML.
    Validation, and the tokens that are expected depend on a DTD or schema which you're not showing, imho.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,185
    Rep Power
    20

    Default

    That's not what the OP is asking about.
    This XML is for some form validation system they are using.
    That is, it defines how to validate an HTML form when received by the server.

    Exactly how this validation system works, of course, we have no idea.

  5. #5
    Jodokus's Avatar
    Jodokus is offline Senior Member
    Join Date
    Jan 2011
    Location
    Amsterdam, the Netherlands
    Posts
    230
    Rep Power
    4

    Default

    @Tolls. You're probably right.
    Could the capital B in "textBox2" be a problem?

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,185
    Rep Power
    20

    Default

    Possibly.
    But as I said, we do not know what this system does.
    We do not know how it works.
    We only have a small bit of XML that is, in itseld, meaningless to us.

Similar Threads

  1. Email Validation
    By juhiswt in forum New To Java
    Replies: 5
    Last Post: 03-08-2011, 04:15 PM
  2. partial XML validation against xsd
    By presto in forum XML
    Replies: 2
    Last Post: 11-21-2009, 06:15 PM
  3. VAlidation
    By chetna1982 in forum New To Java
    Replies: 2
    Last Post: 12-11-2008, 08:08 AM
  4. Help in adding some validation..
    By tornado in forum New To Java
    Replies: 5
    Last Post: 11-30-2008, 02:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •