Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML to XML using XSL with output xml conforming to XSD.

 
Hendrik Louw
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All.
I need to transform XML from one structure to another structure. this output will then be sent to a external app which will proccess this xml.

This is what I have currently.


When ever I attempt to tranform this using Cooktop (An XSL Development tool)
the following error occurs
ERROR: Element content is invalid according to the DTD/Schema.
Expecting: {urn:QuoteComplete}Client.

Source: ' <xsl:call-template name="client" />'
Line: 22, Pos: 42


In java i do not get any output, i.e. blank string ("").

I am assuming that I'm doing this incorrectly, but for the life of me cannot find an example on the net to show the correct way of doing this.

Any help will be appreciated.

[ March 01, 2007: Message edited by: Hendrik Louw ]
[ March 01, 2007: Message edited by: Hendrik Louw ]
 
Paul Clapham
Sheriff
Posts: 21312
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have much experience with Schema, but it looks to me like you declared that your XSL should be validated by a schema. (In the xsl:stylesheet element.)
 
Hendrik Louw
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, thanks for the reply.
I do realize that because I define the namespace ontop it's validating against this name space.

The problem is that I need to output this xml with the name space defenitions, but without having XSL Transformer validate against this name space.

Let me know if this isn't clear.
 
Paul Clapham
Sheriff
Posts: 21312
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I can see that. But I don't see why you have to put all that schema declaration business in the root element of your XSLT. If you want it in elements of your output document then do that where you generate those elements.

You would only need to declare (for example) the xmlns:qc="urn:QuoteComplete" namespace in the root of your XSLT if you were matching on elements in that namespace. And I don't think you are doing that. Not in the example you showed, anyway. And I can't think of any purpose for the xsi:schemaLocation namespace there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic