House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Validate XML Documents

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
All,
Troy Simpson
04/26/04 04:31 P
www.cflib.org/udf.cfm/validateXMLString
Raymond Camden
04/26/04 04:35 P
Thanks for the response.
Troy Simpson
04/26/04 04:39 P
Ah, sorry about that.
Raymond Camden
04/26/04 04:47 P
I guess you can use Java XML parsers
Qasim Rasheed
04/26/04 10:03 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Troy Simpson
04/26/2004 04:31 PM

All, Is there a ColdFusion Function to validate an XML Document against a its schema? Thanks, -- Troy Simpson    Applications Analyst/Programmer, OCPDBA, MCSE, SCSA North Carolina State University Libraries Campus Box 7111 | Raleigh | North Carolina ph.919.515.3855 | fax.919.513.3330 E-mail: Troy_Simpson@ncsu.edu

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Raymond Camden
04/26/2004 04:35 PM

www.cflib.org/udf.cfm/validateXMLString

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Troy Simpson
04/26/2004 04:39 PM

Thanks for the response. This only validates a formatted XML string against a DTD. I need to validate the XML doc against an XSD. Troy Raymond Camden wrote: > www.cflib.org/udf.cfm/validateXMLString

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Raymond Camden
04/26/2004 04:47 PM

Ah, sorry about that.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Qasim Rasheed
04/26/2004 10:03 PM

I guess you can use Java XML parsers Qaso, Thanks for the response. This only validates a formatted XML string against a DTD. I need to validate the XML doc against an XSD. Troy Raymond Camden wrote: > www.cflib.org/udf.cfm/validateXMLString >   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Massimo, Tiziana e Federica
04/27/2004 12:59 AM

The JRE 1.4.2 that ships with CF 6.1 doesn't include XSD validation as part of its APIs. You can install and use another XML parser to do the job (Xerces is the first that comes to mind) You already got suggestion about the code required, the topic is covered very well here: http://www.ibiblio.org/xml/books/xmljava/chapters/ch07s04.html#d0e10881 ---------------------------- Massimo Foti http://www.massimocorner.com Co-Author of Dreamweaver MX 2004 Magic: http://www.dwmagic.com/

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rob
04/26/2004 10:45 PM

On Mon, 2004-04-26 at 13:29, Troy Simpson wrote: > All, > > Is there a ColdFusion Function to validate an XML Document against a its > schema? As far as I know the only java parser (last I heard anyway) that validates with a schema is Xerces (which cf uses I think). However, I don't think there is a standard, cross parser, way in java to do xsd validation (unlike dtd) so there are not many java products that do xsd validation yet. This is quite a stretch as my cf sever is out of commission right now so this is a totally untested code - but you could try something like: <cfscript> parser = CreateObject("java","org.apache.xerces.parsers.DOMParser"); //this might be needed... //parser.init(); parser.setFeature("http://xml.org/sax/features/validation", true); parser.setProperty(   "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",   "test.xsd" ); parser.parse("test.xml"); </cfscript> Look around on the www.apache.org site for xerces xsd validation, if cf still uses it ... it might use Crimson ... some MM guy might chime in... Good luck, -- Rob <me@robrohan.com>

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rob
04/26/2004 11:04 PM

Here is a good blurb on how to do it in java - pretty similar steps in cf http://www.geocities.com/herong_yang/jdk/xsd_validation.html On Mon, 2004-04-26 at 19:39, Rob wrote: ----- Excess quoted text cut - see Original Post for more ----- -- Rob <me@robrohan.com>


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

March 14, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31