[ xframe-Bugs-1228808 ] Question about ant task when using FileSets

"SourceForge.net" <[email protected]> Wed, 28 Sep 2005 14:54:57 -0700
Newsgroups gmane.text.xml.xframe.xsddoc
Message-ID <[email protected]>
Bugs item #1228808, was opened at 2005-06-28 01:58
Message generated for change (Comment added) made by mrpatton
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=454391&aid=1228808&group_id=48863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: all platforms
Group: xsddoc-0.8-beta
Status: Open
Resolution: Accepted
Priority: 5
Submitted By: Kurt Riede (kriede)
Assigned to: Kurt Riede (kriede)
Summary: Question about ant task when using FileSets

Initial Comment:
I had a problem using the ant task in the latest release 
(0.8-beta)  
with nested FileSets.  It worked fine if I specified a 
single, specific  
file to convert, but it would never run against any of my 
files in the  
nested FileSets.  I tracked it down to this code, which 
always returned  
null on my XML schema files:

if (!root.getLocalName().equals("schema") ||  
!root.getNamespaceURI().equals(Task.SCHEMA_NS)) {
return null;
}

This was added during this commit:

http://cvs.sourceforge.net/viewcvs.py/xframe/xsddoc/src/
net/sf/xframe/ 
xsddoc/Task.java?r1=1.21&r2=1.22

No matter what I did, I could not get any of my schema 
files to pass  
either of the tests in that if statement.  I did verify that 
the  
FileSets were matching the files I wanted.  After 
commenting out the  
test above everything worked out great.

So, here's my question: what do I have to do to make 
this work?  I'm  
including the top of one of my XSD files.  These verify 
properly in  
XMLMind, they work with xsddoc, and they work fine 
with Castor.

<?xml version="1.0" encoding="UTF-8"?>
<!-- target package ::= 
org.opennms.netmgmt.xml.eventconf -->
<schema 
targetNamespace="http://xmlns.opennms.org/xsd/eventc
onf"
         xmlns="http://www.w3.org/2001/XMLSchema"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"
         
xmlns:this="http://xmlns.opennms.org/xsd/eventconf"
         xmlns:ns2="http://www.w3.org/1999/xhtml"
         xmlns:ns="http://www.w3.org/2001/XMLSchema"
          
xmlns:hfp="http://www.w3.org/2001/XMLSchema-
hasFacetAndProperty">
   <annotation>
     <documentation>Version: $Id$</documentation>
   </annotation>

   <element name="events">
     <complexType>
... snip ...


Thanks,
- djg


----------------------------------------------------------------------

Comment By: mrpatton (mrpatton)
Date: 2005-09-28 16:54

Message:
Logged In: YES 
user_id=1330069

I have submited a patch for Task.java (bug 1307377) that I 
believe will solve these problems, if they are in fact the same 
problems I was encountering (and they appear to be).

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2005-09-28 06:16

Message:
Logged In: NO 

same issues here. I cannot also get xsddoc to process a
whole directory ( it generates an empty documentation frameset).

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2005-09-24 06:52

Message:
Logged In: NO 

You must simply set the DocumentBuilderFactory to be
namespace aware. Add the statement
factory.setNamespaceAware(true) in Task.getDocumentBuilder().

Regards
/roman

----------------------------------------------------------------------

Comment By: Kurt Riede (kriede)
Date: 2005-08-16 12:57

Message:
Logged In: YES 
user_id=484961

Hi Mark,

thank you for your support.
The best way to provide a patch is to attach the patch here:
https://sourceforge.net/tracker/?group_id=48863&atid=454393
(Click on 'Submit New' and upload your patch-file)

As far as I see, in both your cases, the default namespace of 
the schema is the XML-Schema-Namespace, and for this 
case the test is wrong. I mostly test with schema files where 
the XML-Namespace is bound to a prefix like xs: or xsd: and 
then the fileset is working.
But however, I will check your patch and hope this will soon 
be fixed for the next release.

Regards
Kurt

----------------------------------------------------------------------

Comment By: mrpatton (mrpatton)
Date: 2005-08-16 09:38

Message:
Logged In: YES 
user_id=1330069

Kurty,

I have encountered the same problem and finally tracked 
down what I believe to be the cause.  It appears the 
document builder factory is not being set to "namespace 
aware". In addition, the code path for processing the filesets 
is not using the internal convenience methods for getting a 
new document, so be sure to change that or it won't take 
advantage of the change you make to fix the "namespace 
aware" problem. 

The other problem I think has to be solved in conjunction is 
the one already noted in the Task.java file with respect to 
how the fileset root directories vary relative to the project 
directory. I fixed this by using a more absolute path approach 
to the problem in the addSchema method, eliminating the 
complexity of relative paths.

I would be happy to supply my version of Task.java that 
seems to fix these issues. It works in my scenarios, but I 
have not necessarily tested it with every use case of fileset 
combinations.  What is the best way to submit my changes 
so they can be considered?

Regards,
Mark

----------------------------------------------------------------------

Comment By: Kurt Riede (kriede)
Date: 2005-06-28 02:09

Message:
Logged In: YES 
user_id=484961

Hi Gregor,

I've crossposted this mail as a bug report. The above 
mentioned test was introduced to exclude files that donot 
represent a schema. We will analyse this.

Regards
Kurt

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=454391&aid=1228808&group_id=48863


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl