wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes XML Schema validation for inputs with no namespace Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML Schema validation for inputs with no namespace" Watch "XML Schema validation for inputs with no namespace" New topic
Author

XML Schema validation for inputs with no namespace

Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 761

In my schema file, I declare an element of the sort:

Now when I receive an input that looks like this:

it would not validate this and return it as invalid because I did not specify the namespace. Our clients are expected to send in their files via a socket and it will come in without the xmlns declaration. I'm thinking of modifying the input stream to add the namespace declaration. Is there any other alternatives ?

Regards,

Pho
[ July 12, 2004: Message edited by: Pho Tek ]

Regards,

Pho
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I would look into writing an XSLT stylesheet which transforms the incoming no-namespace elements into namespace'd elements.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML Schema validation for inputs with no namespace
 
Similar Threads
xml schema error
targetNamespace,xmlns
schema import error
xml validation failure
Top_Level Definition