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

"SourceForge.net" <[email protected]> Tue, 16 Aug 2005 07:38:54 -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: None
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-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


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf