[jdom-interest] question on namespaces

Alex Rosen arosen at silverstream.com
Mon Jun 3 06:53:11 PDT 2002


You're trying to treat all the elements that aren't in the fpl namespace as
text? That's not legitimate XML - your <script> tag is an element, not text,
whether you're using JDOM or any other mechanism. To make it be text, you
need to wrap it in a CDATA section, or use &lt;script&gt;.

In general, DTDs and namespaces work very poorly together. It's possible to
modify a DTD to work with namespaces, but only if you require that the
particular prefix that you've used in your DTD is the one that's used in
each document. That works, but it pretty much goes against the intent and
the usefulness of namespaces. On the other hand schemas are namespace-aware,
though they're newer and more complicated.

These issues are particularly related to JDOM itself. You can probably find
info about all these types of things in articles on sites like xml.com.

Alex

> -----Original Message-----
> From: jdom-interest-admin at jdom.org
> [mailto:jdom-interest-admin at jdom.org]On Behalf Of Frank Sauer
> Sent: Thursday, May 30, 2002 12:00 PM
> To: jdom-interest at jdom.org
> Subject: [jdom-interest] question on namespaces
> 
> 
> I apologize if this is a FAQ, but I could not find it there 
> or in the archives.
> 
> I have a need to process files much like XSLT files that look 
> like this:
> 
> <fpl:frame xmlns:fpl="some uri">
> 
> 	<fpl:break name="script">
> 		<script>
> 		
> 		</script>
> 	</fpl:break>
> 	<body>
> 		<fpl:break name="header">
> 		
> 		</fpl:break>
> 	</body>
> </fpl:frame>
> 
> In other words, I need to process the elements in the namespace
> identified by the fpl: prefix but simply consider everything 
> else as content.
> Can anyone out there show me how to set up jdom to do this?
> Can validation be used in this scenario? I have a DTD for the 
> fpl tags but it
> does not use namespaces. Can it? What's a good place to find 
> info on this?
> I used the jdom node factory to instantiate my own Element 
> subclasses for the
> recognized fpl commands, but now I have a need to add 
> namespaces to it so it is
> easier to include xml/html like content without the need for CDATA.
> 
> Thanks,
> 
> Frank Sauer
> The Technical Resource Connection, Inc.
> a wholly owned subsidiary of Perot Systems
> Tampa, FL
> http://www.trcinc.com
> -----------------------------------------------
> "If you don't know where you're going, any road will take you 
> there" --
> Lewis Carroll
> 
> 
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/yo
uraddr at yourhost.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 2992 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20020603/65e619bb/winmail.bin


More information about the jdom-interest mailing list