• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

JDOM

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do you combine XMLSchema validation with the use of DTD's (for entities)?

I have XMLSchema describing my XML instances. An instance is a combination of some parts. The parts can be used in multiple wholes.
So I thought to work in the following way :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE whole [
<!ENTITY p7 SYSTEM "p7.xml">
<!ENTITY p8 SYSTEM "p8.xml">
]>
<whole xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="mySchema.xsd">
&p7;
&p8;
</whole>

My Java code is :
SAXBuilder builder = new SAXBuilder(true);
builder.setFeature("http://apache.org/xml/features/validation/schema", true);
doc = builder.build(new File("PathToMyFile"));

Parsing the input file gives the following error : "Element type "whole" must be declared."

Anyone an idea what I'm doing wrong?
 
Listen. That's my theme music. That's how I know I'm a super hero. That, and this tiny ad told me:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic