axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Srinath Perera <hemap...@vijayaba.cse.mrt.ac.lk>
Subject DOM->JAXME(HELP NEEDED)
Date Fri, 31 Oct 2003 09:51:27 GMT
On Thu, 2003-10-30 at 20:30, Jochen Wiedmann wrote:
> Your schema files are referring to types defined elsewhere. For example
> s:schema or soap-enc:array. Whilst the former may assumed to be known to
> the parser (that's again something I have to clarify), I am quite sure
> that a standard XML Schema parser is not expected to know about the
> schema related files.
> 
> A possible solution on your side might be not to parse the actual schema,
> but to create an outer schema, that imports the WSDL types and then the
> real schema. How's that?

to adress above issue of wsdl defined but not schema defined types we 
thought of importing the soap encoding schema(attached) to the schema.

to import the schema we use following code to add a import element to
the elemnt we going to parsed with JAXME !!.

public void createImportNode(Element e){
  Element element =    
	doc.createElementNS("http://www.w3.org/2001/XMLSchema","import");
		
  Attr attr1 = doc.createAttribute("namespace");
  attr1.setValue("http://schemas.xmlsoap.org/soap/encoding/");
	
  Attr attr2 = doc.createAttribute("schemaLocation");
  attr2.setValue("./schema/schemas.xmlsoap.org.xml");
		
  element.setAttributeNode(attr1);
  element.setAttributeNode(attr2);
		
  e.insertBefore(element,e.getFirstChild());
}

but the parsing failed with error
org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of
element 'schema'.
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

but the both schema taken alone work fine with JAXME.

1) is this something wrong with JAXME or have I make a mistake?
2) anybody knows better way to adress this

thanks for your time

regards

Srinath



Mime
View raw message