|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: validating xml
Brian, Brian Shields wrote: > Hi all, > > I have written a system in java that is automatically processing xml > files. I now need to put a filter in place that ensures the xml file i > recceive matches the schema file contained in my system. If there are > any discrepencies then the file should not be processed. > Is anyone aware of such a tool? > Depends on whether you want to 1) reject the file if it does not comply with your schema or 2) re-form the file so that it matches your schema. If #1, any validation against your schema and XML parser barf should do the trick. If #2, one (contested!) approach is to just filter the elements that don't match your schema. In Jave 1.4, you can complile a regex to match only your markup and pass only that, plus PCDATA to your application. At this point, the demos of JITTs (Just-In-Time-Trees) use a filtering approach but we are closing in on more robust implementations. The danger with #2 is that you may get some odd looking data to your application, depending on how far the submitted data varies from what you require. Depends on whether you are enforcing compliance to insure proper processing or enforcing compliance to insure proper submission. Similar but not exactly the same. Patrick > > Thanks in advance, > Brian. > > > ------------------------------------------------------------------------ > Do you Yahoo!? > Faith Hill <http://faith.yahoo.com> - Exclusive Performances, Videos, > & more > faith.yahoo.com <http://faith.yahoo.com> -- Patrick Durusau Director of Research and Development Society of Biblical Literature pdurusau@e...
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








