<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Meddelande</TITLE>
<META content="MSHTML 6.00.2800.1170" name=GENERATOR>
<STYLE>@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        COLOR: windowtext; FONT-FAMILY: Arial
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><SPAN
class=211115322-17082003>Hi,</SPAN></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><SPAN
class=211115322-17082003></SPAN></SPAN> </DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><SPAN
class=211115322-17082003>Your code works for me, with your schema file. However,
when I copied</SPAN></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><SPAN
class=211115322-17082003>the code snippet, the quotation marks in "includes"
turned out to be</SPAN></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><SPAN
class=211115322-17082003>the opening/closing quotation marks, whereas the
quotation marks in the</SPAN></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><SPAN
class=211115322-17082003>XML portion was just single. Maybe this is because
of your or mine editor or</SPAN></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><SPAN
class=211115322-17082003>mail program, but check for hidden characters in the
"include" string.</SPAN></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><SPAN
class=211115322-17082003></SPAN></SPAN> </DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><SPAN
class=211115322-17082003>/pmn</SPAN></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><SPAN
class=211115322-17082003></SPAN></SPAN> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">We are developing a tool for a
bioinformatics system that allows the user to interact directly with XML
schemas. My code loads a schema and creates a JDOM tree just as if it
were a normal XML document. However, here’s the problem: I’m trying to
get the include child elements from the root element but always the list I’m
returned is empty. Checking using the NetBeans debugger shows that the
JDOM Document object matches the underlying schema.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Right, so here’s my
code:</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Document schema = … // This
code gets the schema from wherever it happens to be and</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 1in; TEXT-INDENT: 0.5in"><FONT
face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">// gives
it to JDOM</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Element root =
schema.getRootElement();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Namespace ns =
root.getNamespace();</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">List includes = root.getChildren(
“include”, ns );</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The List in the last line of code
is always empty, this is even the case when I don’t specify the
namespace. But when I use the debugger it clearly shows that the
namespace of the root element is the same as that of the child elements,
including the include elements. Does anybody have any idea what I’m
doing wrong? I’m using a test schema from the Ordinance Survey in the
</SPAN></FONT><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">UK</SPAN></FONT><FONT face=Arial
size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">, which is as
follows:</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P></DIV></BLOCKQUOTE></BODY></HTML>