0

I need to add the following namespaces to my XSD document:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="catalog.enterprise.level3.com" attributeFormDefault="unqualified">

When I try to add the target namespace, it complains of a MalformedURIException, which I assume is because there is no http:// in the namespace URI. I am using XOM for this.

Element rootWriter; 
rootWriter.addNamespaceDeclaration("tns","catalog.enterprise.level3.com");

Could someone please suggest to me, how to solve this problem.

Perception
  • 79,279
  • 19
  • 185
  • 195
One
  • 15
  • 2
  • 7

1 Answers1

1

The namespace MUST be an URI - for example:

uri:catalog.enterprise.level3.com 

would work. If, as I assume, you have to read a wrongly encoded xml, your only solution I am afraid is to pick a "lower quality" xml parser which does not perform that kind of check - or complain with the person who gave you the file!

thedayofcondor
  • 3,860
  • 1
  • 19
  • 28