Assignment 2 XML Validation - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Assignment 2 XML Validation

Description:

http://www.sun.com/software/xml/developers/multischema ... Don't just replace it with words (AT&T is replaced by ATandT or ATT) Common Mistakes continue ... – PowerPoint PPT presentation

Number of Views:97
Avg rating:3.0/5.0
Slides: 19
Provided by: maa96
Category:

less

Transcript and Presenter's Notes

Title: Assignment 2 XML Validation


1
Assignment 2XML Validation
  • Make sure that the XML files are validated
    against the XML Schema you designed. Use Sun
    Multi-Schema XML Validator (msv).
  • Download the msv validator from the link
  • http//www.sun.com/software/xml/developers/multis
    chema
  • Notice you need to register for that by creating
    user id and password.

2
XML Validation
  • Download/extract the sun multi-scheme XML (msv)
    validator.
  • To test the validator, please use the
    xsd_example.xsd, and xml_example.xml
  • For more help, have a look at the file
    command.html comes with the extract.
  • Use the strict options

3
XML Validation/Example
  • Download the files xsd_example.xsd and
    xml_example.xml from
  • utdallas.edu/maa013600/cs6360/common/xsd_example.
    xsd
  • utdallas.edu/maa013600/cs6360/common/xml_example.
    xml
  • Run the command
  • Cjava -jar ./msv-20030225/msv.jar strict
    xsd_example.xsd xml_example.xml

4
Using Batch file
Using Command line
5
Batch File Contents
6
XML Validation/ExampleError produced by msv
Error produced by msv as a result of invalid
types. I just changed the string type to sstring
and date type to ddate Just for the purpose of
showing you how msv produce errors.
7
XML Validation/Java setup
  • Note that you need to setup java.exe. Please look
    it up in your machine and add it to your path.
  • Here is a screen shot showing that java is set on
    your machine. You can see basically the help of
    java command.

8
XML Validation/Example
  • In case java is not set you will have an error
    message saying
  • 'java' is not recognized as an internal or
    external command, operable program or batch file.
  • In order to set java, search for java.exe in you
    machine, and add the directory java.exe resides
    in your path.
  • For example if java.exe is in the director
    c\program files\jsdk1.4\bin in your machine,
    then set your path by typing
  • promptset path pathc\program
    files\jsdk1.4\bin

9
Can I Use Online XML Validator?
  • Finally, you can use any other XML validators.
  • There are plenty online, but be sure that the
    one you use is following the standards.
  • If you use different validator from msv, you need
    to submit a screen shot of the validation results.

10
Common Mistakes
  • Defining every thing as string.
  • Trying to define Date type.
  • Special characters such as ,, etc..
  • Escape it.
  • http//www.utdallas.edu/maa013600/cs6360/hw2_summ
    er04/faq.html
  • Dont just replace it with words (ATT is
    replaced by ATandT or ATT)

11
Common Mistakes continue
  • Primary keys not defined.
  • Trying to define Foreign keys.
  • Not Testing your keys
  • Inconsistent data.
  • One file has ATT another has ATT
  • Record will not show in the xquery.

12
XQuery/QuiP
  • You need t o download the QuiP from
  • http//www.softwareag.com/developer/quip/
  • For help/FAQ, please have a look at the file
    \QuiP-2.2.1.1\QuiP\doc\index.htm in the download.
  • Linux and Windows plateforms

13
Using the command line
  • Please notice
  • The files needed to run the coming example, and,
  • Useful examples of writing xquery functions
  • Can be found at
  • http//www.utdallas.edu/maa013600/cs6360/common/x
    queries/example.zip

14
Using the command line
  • Down the zip file mentioned in the previous
    slide, then extract it.
  • Make sure that the xml and the xquery files are
    in the same directory.
  • Have a look at the functions that I wrote in the
    xqeury file to accommodate your need.

15
Using the command line
  • Use the quip.exe, which comes with the quip
    extract, command to run any xquery from the
    command prompt.
  • Please have a look at the zip file and the
    following tutorials regarding writing xquery
  • http//www.w3.org/TR/xmlschema-0/
  • http//www.w3.org/TR/2002/WD-xquery-operators-2002
    0816/
  • http//cafeconleche.org/slides/xmlsig/xquery/XQuer
    y.html

16
Running an XQuery from the command line
17
Using the GUI
  • To install the QUIP-GUI, please follow the
    instructions at
  • http//www.utdallas.edu/maa013600/cs6360/hw2_summ
    er04/faq.htmlquipGui
  • Please be aware that if you want to use the GUI,
    then you are on your own. Because I do not have
    time to spare to make it work for you.

18
QUIP Issues
  • Sorting number might not be working.
  • 1,3,10,4 sorted as 10,1,3,4
  • Solution 01,03,10,04 ? 01,03,04,10
  • Try to use built in functions.
  • Get familiar with Quip.
Write a Comment
User Comments (0)
About PowerShow.com