You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Peet Sneekes <pe...@mediamatic.nl> on 2000/02/22 10:14:03 UTC

DTD Expansion not done?

Hi,

I found out I don't expand my DTD in anyway . . . but I thought I set all
features for doing so. . .
Any suggestions would be apriciated.

Thanks,

Peet, Mediamatic IP, Amsterdam

<!--______________JAVA__________________________________________________-->
 . . . . .
  DOMParser parser = new DOMParser();
  StringWriter swErrorHandler = new StringWriter();
  ErrorHandler eh = (ErrorHandler) new
MMErrorHandler_Apache(swErrorHandler);


{ 

   parser.setErrorHandler(eh);
     parser.setEntityResolver(new MmXercesResolver(itsDependencies,0 ,theRequestContext));
   parser.setFeature("http://xml.org/sax/features/validation", true);
   parser.setFeature("http://xml.org/sax/features/external-general-entities", true);
   parser.setFeature("http://xml.org/sax/features/external-parameter-entities", true);
   parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", false);

  } catch(SAXParseException e) {
   throw new StorageException(this.getClass(), "parsing error", swErrorHandler.toString(),e);
  } catch(SAXException e) {
   throw new StorageException(this.getClass(), "parsing error", swErrorHandler.toString(),e);
  }
  
  InputSource source = new InputSource(itsStore.getPersistency().getReader(itsUrl));
  try{ 
     parser.parse(source);
 . . . . 
<!--______________XML___________________________________________________-->
<?xml version="1.0"?>
<!DOCTYPE messages[
<!ENTITY submitURL "/werk/solliciteren_submit.rml">
<!ENTITY e1 "entity 1">
<!ENTITY e2 "entity 2">
]>
<meldingen>
 the first(&e1;)
 the last(&e2;)l;dfg
 &submitURL;
</meldingen>



Re: DTD Expansion not done?

Posted by Pierpaolo Fumagalli <pi...@apache.org>.
Peet Sneekes wrote:
> 
> Hi,
> 
> I found out I don't expand my DTD in anyway . . . but I thought I set all
> features for doing so. . .
> Any suggestions would be apriciated.

Try to look for the child nodes of EntityReference nodes.

	Pier

-- 
--------------------------------------------------------------------
-          P              I              E              R          -
stable structure erected over water to allow the docking of seacraft
<ma...@betaversion.org>    <http://www.betaversion.org/~pier/>
--------------------------------------------------------------------
- ApacheCON Y2K: Come to the official Apache developers conference -
-------------------- <http://www.apachecon.com> --------------------