• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Validating data in XML file

Community Beginner ,
Aug 17, 2009 Aug 17, 2009

Copy link to clipboard

Copied

Hi gang ..

Just got a project (unfished) which I have to parse & validate an xml document .. the work to be done is as follows:

1. Gather xml

2. Parse data

3. Validate data

4. Insert data into db

5. Send message back to browser

I'm not sure what's the best way to go about accomplishing this in a productive way utilizing all that's out there.

Any help would be appreciated.  (xml file is enclosed)

Netpagino

TOPICS
Advanced techniques

Views

736

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Aug 18, 2009 Aug 18, 2009

I do not know exactly what you mean by "validating data in an XML file."  At first blush, I interpreted your inquiry to mean that you wanted to verify that the XML file was well-formed ... that is to say, conformant to its DTD or Schema.  But on re-reading your post, I'm not sure.

Certainly, you want to fully employ CF's in-built XML processing and querying capabilities.  (You want to use an XPath search to locate the nodes, for instance...)  As to the subsequent task of thereafter checking the d

...

Votes

Translate

Translate
Engaged ,
Aug 18, 2009 Aug 18, 2009

Copy link to clipboard

Copied

I do not know exactly what you mean by "validating data in an XML file."  At first blush, I interpreted your inquiry to mean that you wanted to verify that the XML file was well-formed ... that is to say, conformant to its DTD or Schema.  But on re-reading your post, I'm not sure.

Certainly, you want to fully employ CF's in-built XML processing and querying capabilities.  (You want to use an XPath search to locate the nodes, for instance...)  As to the subsequent task of thereafter checking the data in those nodes against various business rules, well, that would take more thought.  But do remember (a) that this is very well-trod ground (so "don't re-invent the wheel"), and (b) you have all of Java at your disposal should you require it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 18, 2009 Aug 18, 2009

Copy link to clipboard

Copied

LATEST

Thanks for the reply TLC-IT ..

I agree on not reinventing the wheel .. I'd much rather start the project from beginning instead of what I have in front of me now ..

I will work to get as best of a result as I can ..

So for the sake of making sure I have the process correctly, what steps would you follow on the following scenario which is the basis for

this project ..

1. User submits request via web app to get latest list of information

2. Web app makes a call for xml data to be processed: validated against business rules (data type, not nulls, etc)

3. Upon successful validation a message is sent back to app with success message

4. Upon errors found a message is sent back to app with errors

Alternatively .. I will work on some sort of validation for this, however I can't think of a way to validate the data which comes from an xml file & looks to be loaded into an array ..

Thanks ..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation