[jdom-interest] RE: no method: Element.setName(String)

Vamshi Reddy vreddy at whn.com
Wed Sep 20 13:20:25 PDT 2000


Travers,

I had the same question. Brett said that it was intensionally removed. I
found an alternate solution to this problem although it can be
memory-intensive if the element/tree is large.

This message was never posted? See below. Hope this helps.

Vamshi Reddy

RE: Class org.jdom.Element

methods: setName(string), setName(string, string)

These methods are in current JavaDoc drop:  jdom-b3_docs(168k). Jason
replied to the mail (sorry for sending it direct) by saying that these
methods were intentionally removed. If a default constructor Element() is
available then how is it possible to set the name after creating and setting
all the required nodes?

If you try to take a child element from another parent element and add it to
a newly created root element, an exception is thrown as this is not allowed.
A way around this is to  clone the required element and add it to the new
root element. If all you wanted to do is to perform an in-line update to the
current document and send it to an output stream.


 Element oldChild =
(Element)document.getRootElement().getChild("Child").clone();
 List oldRootAttributes = document.getRootElement().getAttributes(); //save
all old attribs
 doc = null; //dump the old document or ...

Element newRootElement = new Element("NewRoot");
  newElement.setAttributes(oldRootAttributes); //or individually add:
newElement.setAttribute("name", "value")
	.....more code......

document = new Document(newRootElement, new
DocType(newRootElement.getName(), "external.dtd"));

All this can be avoided by setName(). I modified the source at the time I
needed it but removed it after I received the mail to avoid future errors as
the updates occur.

Please suggest any better ways of getting around this.

Thanks,

vr

-----Original Message-----
From: jdom-interest-admin at jdom.org
[mailto:jdom-interest-admin at jdom.org]On Behalf Of
jdom-interest-request at jdom.org
Sent: Tuesday, September 19, 2000 11:02 PM
To: jdom-interest at jdom.org
Subject: jdom-interest digest, Vol 1 #246 - 13 msgs


Send jdom-interest mailing list submissions to
	jdom-interest at jdom.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.denveronline.net/mailman/listinfo/jdom-interest
or, via email, send a message with subject or body 'help' to
	jdom-interest-request at jdom.org

You can reach the person managing the list at
	jdom-interest-admin at jdom.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of jdom-interest digest..."


Today's Topics:

  1. Re: DTD im XML-File and Element.getContent() (Marcus Breig)
  2. no method: Element.setName(String). Why? (Travers Waker)
  3. Re: Off Topic - XSL (Xalan) question (Aidan Killian)
  4. Problem with DTD (Steven Smith)
  5. static data needs to be thread data for multithreaded application
 s (Nick Reeves)
  6. XMLOutputter - setExpandEmptyElements(true) not functioning
 properly. (kendrick at us.ibm.com)
  7. [BUG] (Wolfgang Werner)
  8. Re: [BUG] (Brett McLaughlin)
  9. Re: XMLOutputter - setExpandEmptyElements(true) not
 functioningproperly. (Brett McLaughlin)
  10. Re: DTD im XML-File and Element.getContent() (Brett McLaughlin)

--__--__--

Message: 1
Date: Tue, 19 Sep 2000 09:01:39 +0200
From: Marcus Breig <mbreig at i2ag.de>
Reply-To: mbreig at i2ag.de
Organization: IQUADRAT AG, Wuppertal
To: Brett McLaughlin <brett.mclaughlin at lutris.com>
CC: JDOM-Liste <jdom-interest at jdom.org>
Subject: Re: [jdom-interest] DTD im XML-File and Element.getContent()
boundary="------------3EBF27EA2DD375AE51700D86"

Dies ist eine mehrteilige Nachricht im MIME-Format.
--------------3EBF27EA2DD375AE51700D86
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi Brett,

the XML-File (with DTD) in the attachment...

Marcus

Brett McLaughlin schrieb:

> Marcus Breig wrote:
> > My problem: my sample XML-File contains a DTD for
> > defining my XML-language. In this case the method
> > Element.getContent() always returns an empty string.
>
> Can you post your XML document? I think I know what this is, but I want
> to make sure.
>
> Thanks
> Brett

--------------3EBF27EA2DD375AE51700D86
Content-Type: text/xml; charset=iso-8859-1;
 name="users.xml"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline;
 filename="users.xml"

<?xml version='1.0' encoding="ISO-8859-1" standalone="yes" ?>

<!DOCTYPE users [

	<!ELEMENT users (groups, user+) >

		<!ELEMENT groups (group)+ >
			<!ELEMENT group (members, accessRights, commandRights)+ >
			<!ATTLIST group name CDATA #REQUIRED >
				<!ELEMENT members (member)+ >
					<!ELEMENT member (#PCDATA) >
				<!ELEMENT accessRights (table)+ >
					<!ELEMENT table EMPTY >
					<!ATTLIST table name CDATA #REQUIRED >
					<!ATTLIST table canRead (true|false) "false" >
					<!ATTLIST table canWrite (true|false) "false" >
				<!ELEMENT commandRights (tableCmds)+  >
					<!ELEMENT tableCmds (command)+ >
					<!ATTLIST tableCmds tablename CDATA #REQUIRED >
						<!ELEMENT command EMPTY >
						<!ATTLIST command name CDATA #REQUIRED >
						<!ATTLIST command allowed (true|false) "false" >
		<!ELEMENT user (config, accessRights*, commandRights*, information*) >
			<!ELEMENT config (nickname, top, store) >
				<!ELEMENT nickname (#PCDATA) >
				<!ELEMENT top (#PCDATA) >
				<!ELEMENT store (#PCDATA) >
			<!ELEMENT information (nachname, vorname, anschrift, plz, ort, telefon,
telefax, email) >
				<!ELEMENT nachname (#PCDATA) >
				<!ELEMENT vorname (#PCDATA) >
				<!ELEMENT anschrift (#PCDATA) >
				<!ELEMENT plz (#PCDATA) >
				<!ELEMENT ort (#PCDATA) >
				<!ELEMENT telefon (#PCDATA) >
				<!ELEMENT telefax (#PCDATA) >
				<!ELEMENT email (#PCDATA) >
]>

<!-- hier folgt die Beschreibung der Benutzergruppen, Zugriffsrechte und
Benutzer -->

<users>

	<groups>

		<group name="projektleiter">
			<members>
				<member>MB</member>
				<member>RS</member>
			</members>
			<accessRights>
				<table name="adressen" canRead="true" canWrite="true" />
				<table name="dokumente" canRead="true" canWrite="true" />
				<table name="projekte" canRead="true" canWrite="true" />
			</accessRights>
			<commandRights>
				<tableCmds tablename="adressen">
					<command name="new" allowed="true" />
					<command name="edit" allowed="true" />
					<command name="delete" allowed="true" />
					<command name="copy" allowed="true" />
				</tableCmds>
				<tableCmds tablename="dokumente">
					<command name="new" allowed="true" />
					<command name="edit" allowed="true" />
					<command name="export" allowed="true" />
					<command name="import" allowed="true" />
					<command name="lock" allowed="true" />
					<command name="copy" allowed="true" />
					<command name="release" allowed="true" />
					<command name="delete" allowed="true" />
					<command name="view" allowed="true" />
				</tableCmds>
				<tableCmds tablename="projekte">
					<command name="new" allowed="true" />
					<command name="edit" allowed="true" />
					<command name="delete" allowed="true" />
					<command name="copy" allowed="true" />
				</tableCmds>
			</commandRights>
		</group>
	</groups>


	<user>
		<config>
			<nickname>SM</nickname>
			<top>/</top>
			<store>/ENTWICKLUNG/SOURCE/SM</store>
		</config>
		<information>
			<nachname>Meisner</nachname>
			<vorname>Hans Georg-Stefan Andreas Bernhard</vorname>
			<anschrift>Lünener Str. 31</anschrift>
			<plz>40472</plz>
			<ort>Düsseldorf</ort>
			<telefon>0211-6011976</telefon>
			<telefax>-</telefax>
			<email>sm at i2ag.de</email>
		</information>
	</user>
	<user>
		<config>
			<nickname>ML</nickname>
			<top>/</top>
			<store>/ML</store>
		</config>
		<information>
			<nachname>Loges</nachname>
			<vorname>Marc</vorname>
			<anschrift>-</anschrift>
			<plz>00000</plz>
			<ort>Wuppertal</ort>
			<telefon>0202-???</telefon>
			<telefax>-</telefax>
			<email>ml at kbld.de</email>
		</information>
	</user>
</users>
--------------3EBF27EA2DD375AE51700D86--


--__--__--

Message: 2
From: "Travers Waker" <traversw at innoforge.co.za>
To: <jdom-interest at jdom.org>
Date: Tue, 19 Sep 2000 10:58:54 +0200
charset="iso-8859-1"
Subject: [jdom-interest] no method: Element.setName(String). Why?

Hi all.

I've found a need for the following method of the Element class (but it
doesn't exist):

 Element.setName(String name)

Is there a technical reason why this method can't exist in the current Jdom?

At the moment I'm getting around this limitations as follows:
use Element.getCopy(String name) to create a clone (deep copy) of the
element.  This is pretty wasteful, because I don't need the original element
tree any more and would liek to reuse it with a new root element name
instread of doing expensive deep copies.

In case you're interested in where I'm applying this: It's to represent
request and response message pairs.  In most cases, the XML request message
is exactly the same as the response message except for:
1. The root element is called {something}ResponseMessage instead of
{something}RequestMessage.
2. The addition of a  ResponseCode child element.
3. The addition of a ResponseMessage child element.

2 and 3 are easy to do with Jdom, but changing the name of the root element
is not.

Thanks for any help or info.

Travers



--__--__--

Message: 3
Date: Tue, 19 Sep 2000 10:50:15 +0100
From: Aidan Killian <aidan at concordianet.com>
Organization: Concordia Net, Inc.
To: jdom-interest at jdom.org, VanDoorenD at icfg.com
Subject: [jdom-interest] Re: Off Topic - XSL (Xalan) question

jdom-interest-request at jdom.org wrote:

>
> From: "Van Dooren, Damian" <VanDoorenD at icfg.com>
> To: "JDOM (E-mail)" <jdom-interest at jdom.org>
> Date: Mon, 18 Sep 2000 11:43:32 -0400
> charset="iso-8859-1"
> Subject: [jdom-interest] Off Topic - XSL (Xalan) question
>
> ...
>
> org.apache.xalan.xslt.XSLProcessorException: The reference to entity
> "subaction"  must end with the ';' delimiter.
>
> This is the line it is dying on:
>
> <a
>
href='http://localhost/login/ActionServer?action=loadpage&subaction=html&fil
> eName=client-inquiry.html'>Client Inquiry</a>
>
> I've included the XSL and have commented out the offending line. If
someone
> could point out what I've done wrong I would greatly appreciated it.
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>                 version="1.0"
> >
>   <xsl:template match="/">
>     <html>
>       <head><title>Main Menu</title></head>
>
>       <body bgcolor="#FFFFFF">
>         <h2>Main Menu</h2>
>         <p>
> <!-- Why doesn't it like this line?
>         <a
>
href='http://localhost/login/ActionServer?action=loadpage&subaction=html&fil
> eName=client-inquiry.html'>Client Inquiry</a>
> -->
>         </p>
>       </body>
>     </html>
>   </xsl:template>
> </xsl:stylesheet>
>
> Hi Damian,

    The parameter separator in the URL is being interpreted as an entity
reference open; an XML parser sees '&subaction' and says where is the
entity reference close (';').

    You need to escape the '&'s using '&amp;'s as follows (line wrapped by
me):

href='http://localhost/login/ActionServer?action=loadpage&amp;
subaction=html&amp;fileName=client-inquiry.html'>

Regards,
    Aidan Killian



--__--__--

Message: 4
From: "Steven Smith" <ssmith at neonsys.com>
To: jdom-interest at jdom.org
Date: Tue, 19 Sep 2000 10:50:59 -0500
Boundary="0__=Qc36xzptzVvMSf0Gfs5kxuBCf33gOVwbUupCcL4uzjFlLveJqQnqLcN1"
Subject: [jdom-interest] Problem with DTD

--0__=Qc36xzptzVvMSf0Gfs5kxuBCf33gOVwbUupCcL4uzjFlLveJqQnqLcN1
Content-type: text/plain; charset=us-ascii
Content-Disposition: inline



(Embedded image moved to file: pic22322.pcx)   Steven Smith @ NEON
09/19/2000 10:50 AM


My apologies for the most basis of questions....

I have a very simple XML document that I'm trying to manipulate with JDOM.
The DOCTYPE is as follows:

     <!DOCTYPE test SYSTEM "test.dtd">

When I attempt to construct a Document via SAXBuilder.build(), I get the
following exception:

     org.jdom.JDOMException: File "test.dtd" not found.: Error on line 0:
File "test.dtd" not found.

I am running my program from the command prompt in Windows 2000 and
test.dtd is in my current directory.  I don't understand why the dtd can't
be located.

Any help would be most appreciated.

Thanks,

Steven

--0__=Qc36xzptzVvMSf0Gfs5kxuBCf33gOVwbUupCcL4uzjFlLveJqQnqLcN1
Content-type: application/octet-stream;
	name="pic22322.pcx"
Content-Disposition: attachment; filename="pic22322.pcx"
Content-transfer-encoding: base64

CgUBCAAAAAAtADMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAABLgABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAADYD8wPxg/DDw/YD8wPxg/DDw/YD8wPxg/DDw/YD8wPxg/DDw/CDw4PDtUP
yw/FD8MPDw8ODw4PDtUPyg/FD8MPDw4PDg8ODw7UD8oPxQ/DDw8PDg8ODw4PDtQPyg/FD8IPDw4P
Dg8ODw7UD8oPxQ/DDw8PDg8ODw4PDsgPxA7OD8cPww/CD8IPDg8ODw7ID8YOzQ/HD8MPwg/DDw4P
DsgPyA7ND8YPww/CD84PyA7ND8YPww/CD84PyA7ND8YPww/CD84PyA7ND8YPww/CD88Pxg7ND8cP
ww/CD9APxA7OD8cPww/CD9gPxA8ODA4MyA/ED8IP2A/DDw4MDgwODMcPxA/CD9gPwg8ODA4MDgwO
DMcPww/CD9gPwg8MDgwODA4MDscPww/CD9gPwg8ODA4MDgwODMcPww/CD9gPwg8MDgwODA4MDscP
ww/CD9gPww8MDgwODA7HD8QPwg/YD8QPDA4MDsgPxA/CD9gPzA/GD8MPD9gPzA/GD8MPD9gPzA/G
D8MPD9gPzA/GD8MPD9gPzA/EDMQPwg/YD8sPxgzDD8IP2A/KD8cMDMMPD9gPyg/HDAzDDw/YD8oP
xwwMww8P2A/KD8cMDMMPD9gPyw/GDMMPwg/YD8wPxAzED8IP2A/MD8YPww8P2A/MD8YPww8P2A/M
D8YPww8P2A/MD8YPww8P2A/MD8YPww8P2A/MD8YPww8P2A/MD8YPww8P2A/MD8MPxATCDw/YD8wP
wg/FBATCD9gPzA8PxQTDBA/YD8wPD8UEwwQP2A/MDw/FBMMED9gPzA8PxQTDBA/YD8wPwg/FBATC
D9gPzA/DD8QEwg8PDAAAAIAAAACAAICAAAAAgIAAgACAgICAgMDAwP8AAAD/AP//AAAA//8A/wD/
/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==

--0__=Qc36xzptzVvMSf0Gfs5kxuBCf33gOVwbUupCcL4uzjFlLveJqQnqLcN1--


--__--__--

Message: 5
From: Nick Reeves <Nick.Reeves at gtl.com>
To: "'jdom-interest at jdom.org'" <jdom-interest at jdom.org>
Date: Tue, 19 Sep 2000 15:40:03 +0100
charset="iso-8859-1"
Subject: [jdom-interest] static data needs to be thread data for
multithreaded application
s

Let me make clear first of all I am not asking for individual JDOM Objects
to be thread safe. I fully agree that the caller should be responsible for
this, following the example of the Java Collections API.

However where the class has hidden static data (such as
Namespace.namespaces)the class must be responsible for making access to this
thread safe otherwise multithreaded applications such as your typical Web or
EJB case, have no choice but to single thread all use of the JDOM packages
:(. This would lead to appalling performance in any realistic use.

At present multihreaded use of Namespace.getNamespace even indirectly (eg by
importing files in different threads) will cause random failures with
ConcurrentModificationException.


--__--__--

Message: 6
From: kendrick at us.ibm.com
To: jdom-interest at jdom.org
Date: Tue, 19 Sep 2000 13:13:44 -0400
Subject: [jdom-interest] XMLOutputter - setExpandEmptyElements(true) not
functioning
properly.



I am seeing my empty elements (content of an empty String) outputted in the
shorthand format (<tagName />) even after I issued
setExpandEmptyElements(true).  I traced the code in XMLOutputter.
printElement() to:

     ...
     if (empty) {
          // Simply close up
          if (!expandEmptyElements) {
               out.write(" />");
          } else {
               out.write("></");
               out.write(element.getQualifiedName());
               out.write(">");
          }
          maybePrintln(out);
     } else if (stringOnly) {
          // Print the tag  with String on same line
          // Example: <tag name="value">content</tag>
          // Also handle "" being added to content
          String elementText = element.getText();
          if ((elementText != null) && (!elementText.equals(""))) {
               out.write(">");
               out.write(escapeElementEntities(element.getText()));
               out.write("</");
               out.write(element.getQualifiedName());
               out.write(">");
          } else {
==========>
== here ==>         out.write(" />");
==========>
          }
          maybePrintln(out);
     } else {
     ...

Apparently the check for expandEmptyElements needs to occur here as well.

Sincerely,
Shannon

IBM e-business Integration Services
3200 Windy Hill Road - Atlanta, GA 30332 - WG06B
Phone: 770-835-7672 T/L 445   FAX: 770-835-6479
Internet: kendrick at us.ibm.com



--__--__--

Message: 7
From: "Wolfgang Werner" <wwerner at picturesafe.de>
To: "Jdom-Interest at Jdom. Org" <jdom-interest at jdom.org>
Date: Tue, 19 Sep 2000 22:15:44 +0200
charset="iso-8859-1"
Subject: [jdom-interest] [BUG]

Hello,

I think I found a very small Bug in Element.java:

If you create an Element without textual content, e.g

	Element e = new Element("test");

and put it into an Document, the function

	e.getText()

on this element fails with a NullPointerException due to the
shortcut in the first lines: Access to content.

A short look at the code reveals that other funtions do a
test for this before atempting to access the content list.

Did I miss something? I tested this on the CVS code from
(i think) two days ago.

Thanks,

	Wolfgang Werner

--__--__--

Message: 8
Date: Tue, 19 Sep 2000 19:27:45 -0500
From: Brett McLaughlin <brett.mclaughlin at lutris.com>
Organization: Lutris Technologies
CC: "Jdom-Interest at Jdom. Org" <jdom-interest at jdom.org>
Subject: Re: [jdom-interest] [BUG]



Wolfgang Werner wrote:
>
> Hello,
>
> I think I found a very small Bug in Element.java:
>
> If you create an Element without textual content, e.g
>
>         Element e = new Element("test");
>
> and put it into an Document, the function
>
>         e.getText()
>
> on this element fails with a NullPointerException due to the
> shortcut in the first lines: Access to content.
>
> A short look at the code reveals that other funtions do a
> test for this before atempting to access the content list.
>
> Did I miss something? I tested this on the CVS code from
> (i think) two days ago.

I fixed this ... give it a try now with the latest from CVS.

-Brett

>
> Thanks,
>
>         Wolfgang Werner
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com

--
Brett McLaughlin, Enhydra Strategist
Lutris Technologies, Inc.
1200 Pacific Avenue, Suite 300
Santa Cruz, CA 95060 USA
http://www.lutris.com
http://www.enhydra.org

--__--__--

Message: 9
Date: Tue, 19 Sep 2000 19:30:10 -0500
From: Brett McLaughlin <brett.mclaughlin at lutris.com>
Organization: Lutris Technologies
CC: jdom-interest at jdom.org
Subject: Re: [jdom-interest] XMLOutputter - setExpandEmptyElements(true) not
functioningproperly.



kendrick at us.ibm.com wrote:
>
> I am seeing my empty elements (content of an empty String) outputted in
the
> shorthand format (<tagName />) even after I issued
> setExpandEmptyElements(true).  I traced the code in XMLOutputter.
> printElement() to:
>
>      ...
>      if (empty) {
>           // Simply close up
>           if (!expandEmptyElements) {
>                out.write(" />");
>           } else {
>                out.write("></");
>                out.write(element.getQualifiedName());
>                out.write(">");
>           }
>           maybePrintln(out);
>      } else if (stringOnly) {
>           // Print the tag  with String on same line
>           // Example: <tag name="value">content</tag>
>           // Also handle "" being added to content
>           String elementText = element.getText();
>           if ((elementText != null) && (!elementText.equals(""))) {
>                out.write(">");
>                out.write(escapeElementEntities(element.getText()));
>                out.write("</");
>                out.write(element.getQualifiedName());
>                out.write(">");
>           } else {
> ==========>
> == here ==>         out.write(" />");
> ==========>
>           }
>           maybePrintln(out);
>      } else {
>      ...
>
> Apparently the check for expandEmptyElements needs to occur here as well.

Yup. Just fixed it - try it now, and let me know if it works.

Thanks,
Brett

>
> Sincerely,
> Shannon
>
> IBM e-business Integration Services
> 3200 Windy Hill Road - Atlanta, GA 30332 - WG06B
> Phone: 770-835-7672 T/L 445   FAX: 770-835-6479
> Internet: kendrick at us.ibm.com
>
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com

--
Brett McLaughlin, Enhydra Strategist
Lutris Technologies, Inc.
1200 Pacific Avenue, Suite 300
Santa Cruz, CA 95060 USA
http://www.lutris.com
http://www.enhydra.org

--__--__--

Message: 10
Date: Tue, 19 Sep 2000 19:32:17 -0500
From: Brett McLaughlin <brett.mclaughlin at lutris.com>
Organization: Lutris Technologies
CC: JDOM-Liste <jdom-interest at jdom.org>
Subject: Re: [jdom-interest] DTD im XML-File and Element.getContent()



Marcus Breig wrote:
>
> Hi Brett,
>
> the XML-File (with DTD) in the attachment...

Ahhh, yes. We have some known problems with inline DOCTYPE definitions -
I will work on this soon, and report the fix. Thanks!

-Brett

>
> Marcus
>
> Brett McLaughlin schrieb:
>
> > Marcus Breig wrote:
> > > My problem: my sample XML-File contains a DTD for
> > > defining my XML-language. In this case the method
> > > Element.getContent() always returns an empty string.
> >
> > Can you post your XML document? I think I know what this is, but I want
> > to make sure.
> >
> > Thanks
> > Brett
>
>   ------------------------------------------------------------------------
> <?xml version='1.0' encoding="ISO-8859-1" standalone="yes" ?>
>
> <!DOCTYPE users [
>
>         <!ELEMENT users (groups, user+) >
>
>                 <!ELEMENT groups (group)+ >
>                         <!ELEMENT group (members, accessRights,
commandRights)+ >
>                         <!ATTLIST group name CDATA #REQUIRED >
>                                 <!ELEMENT members (member)+ >
>                                         <!ELEMENT member (#PCDATA) >
>                                 <!ELEMENT accessRights (table)+ >
>                                         <!ELEMENT table EMPTY >
>                                         <!ATTLIST table name CDATA
#REQUIRED >
>                                         <!ATTLIST table canRead
(true|false) "false" >
>                                         <!ATTLIST table canWrite
(true|false) "false" >
>                                 <!ELEMENT commandRights (tableCmds)+  >
>                                         <!ELEMENT tableCmds (command)+ >
>                                         <!ATTLIST tableCmds tablename
CDATA #REQUIRED >
>                                                 <!ELEMENT command EMPTY >
>                                                 <!ATTLIST command name
CDATA #REQUIRED >
>                                                 <!ATTLIST command allowed
(true|false) "false" >
>                 <!ELEMENT user (config, accessRights*, commandRights*,
information*) >
>                         <!ELEMENT config (nickname, top, store) >
>                                 <!ELEMENT nickname (#PCDATA) >
>                                 <!ELEMENT top (#PCDATA) >
>                                 <!ELEMENT store (#PCDATA) >
>                         <!ELEMENT information (nachname, vorname,
anschrift, plz, ort, telefon, telefax, email) >
>                                 <!ELEMENT nachname (#PCDATA) >
>                                 <!ELEMENT vorname (#PCDATA) >
>                                 <!ELEMENT anschrift (#PCDATA) >
>                                 <!ELEMENT plz (#PCDATA) >
>                                 <!ELEMENT ort (#PCDATA) >
>                                 <!ELEMENT telefon (#PCDATA) >
>                                 <!ELEMENT telefax (#PCDATA) >
>                                 <!ELEMENT email (#PCDATA) >
> ]>
>
> <!-- hier folgt die Beschreibung der Benutzergruppen, Zugriffsrechte und
Benutzer -->
>
> <users>
>
>         <groups>
>
>                 <group name="projektleiter">
>                         <members>
>                                 <member>MB</member>
>                                 <member>RS</member>
>                         </members>
>                         <accessRights>
>                                 <table name="adressen" canRead="true"
canWrite="true" />
>                                 <table name="dokumente" canRead="true"
canWrite="true" />
>                                 <table name="projekte" canRead="true"
canWrite="true" />
>                         </accessRights>
>                         <commandRights>
>                                 <tableCmds tablename="adressen">
>                                         <command name="new" allowed="true"
/>
>                                         <command name="edit"
allowed="true" />
>                                         <command name="delete"
allowed="true" />
>                                         <command name="copy"
allowed="true" />
>                                 </tableCmds>
>                                 <tableCmds tablename="dokumente">
>                                         <command name="new" allowed="true"
/>
>                                         <command name="edit"
allowed="true" />
>                                         <command name="export"
allowed="true" />
>                                         <command name="import"
allowed="true" />
>                                         <command name="lock"
allowed="true" />
>                                         <command name="copy"
allowed="true" />
>                                         <command name="release"
allowed="true" />
>                                         <command name="delete"
allowed="true" />
>                                         <command name="view"
allowed="true" />
>                                 </tableCmds>
>                                 <tableCmds tablename="projekte">
>                                         <command name="new" allowed="true"
/>
>                                         <command name="edit"
allowed="true" />
>                                         <command name="delete"
allowed="true" />
>                                         <command name="copy"
allowed="true" />
>                                 </tableCmds>
>                         </commandRights>
>                 </group>
>         </groups>
>
>         <user>
>                 <config>
>                         <nickname>SM</nickname>
>                         <top>/</top>
>                         <store>/ENTWICKLUNG/SOURCE/SM</store>
>                 </config>
>                 <information>
>                         <nachname>Meisner</nachname>
>                         <vorname>Hans Georg-Stefan Andreas
Bernhard</vorname>
>                         <anschrift>Lünener Str. 31</anschrift>
>                         <plz>40472</plz>
>                         <ort>Düsseldorf</ort>
>                         <telefon>0211-6011976</telefon>
>                         <telefax>-</telefax>
>                         <email>sm at i2ag.de</email>
>                 </information>
>         </user>
>         <user>
>                 <config>
>                         <nickname>ML</nickname>
>                         <top>/</top>
>                         <store>/ML</store>
>                 </config>
>                 <information>
>                         <nachname>Loges</nachname>
>                         <vorname>Marc</vorname>
>                         <anschrift>-</anschrift>
>                         <plz>00000</plz>
>                         <ort>Wuppertal</ort>
>                         <telefon>0202-???</telefon>
>                         <telefax>-</telefax>
>                         <email>ml at kbld.de</email>
>                 </information>
>         </user>
> </users>

--
Brett McLaughlin, Enhydra Strategist
Lutris Technologies, Inc.
1200 Pacific Avenue, Suite 300
Santa Cruz, CA 95060 USA
http://www.lutris.com
http://www.enhydra.org


--__--__--

_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com

End of jdom-interest Digest_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com




More information about the jdom-interest mailing list