Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-21-2009, 06:56 AM
Member
 
Join Date: Aug 2007
Posts: 4
Rep Power: 0
presto is on a distinguished road
Arrow partial XML validation against xsd
Hi!

The scene:

I've a webservice defined in a wsdl. For each port, there is an xsd file defining its type. Ok, now I want to validate this xml against this xsd.
The problem:

My xsd's has no root element. They just define a type of node. for instance:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="..." xmlns:bons0="..." targetNamespace="...">
	<xsd:complexType name="MyServiceRequest">
		<xsd:sequence>
			<xsd:element minOccurs="1" name="MyElement" type="xsd:string">
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
</xsd:schema>
but my xml has a root element that is a "MyServiceRequest" node:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<MyService>
    <MyElement>my element value</MyElement>
</MyService>
How can I validate just the "internal" part of the root node against my xsd? or my full xml against the wsdl, if there is a way...

Regards!
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 11-21-2009, 04:30 PM
Member
 
Join Date: Feb 2008
Posts: 74
Rep Power: 0
Menre is on a distinguished road
Default
It may help if you use some PHP code to validate your XML and xsd. Read the article below and see if you can apply the techniques to your work.

Validating XML in PHP

I hope this helps.
Menre
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 11-21-2009, 06:15 PM
Member
 
Join Date: Aug 2007
Posts: 4
Rep Power: 0
presto is on a distinguished road
Default
Thanks for the reply Menre!
I'll take a look at this!

I forgot to say, but I'm using jsp and servlets (java 5 xml packages -> javax.xml.*.*).

Regards,
Presto
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Tags
schema, xsd

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display partial file contents in JTextArea tmoehlman New To Java 0 11-03-2009 12:03 AM
UPS Address Validation Example snappy3573 Java Blogs 1 08-25-2009 05:47 AM
VAlidation chetna1982 New To Java 2 12-11-2008 08:08 AM
Input Validation kickflipper1087 New To Java 5 11-03-2008 06:47 AM
HELP: Trouble with partial filled arrays daigre7 New To Java 1 04-07-2008 03:05 AM


All times are GMT +2. The time now is 11:02 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org