You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Norman Walsh <nd...@nwalsh.com> on 2000/10/25 20:01:57 UTC

'make clean'?

FAQ? I can't seem to 'make clean' using the CVS checkouts of Xerces on
my Linux box. The problem is that in the recursive process if there
are no more directories to clean, the following statement:

	@if [ -n "$(DIRS)" ]; \
	then for i in $(DIRS);do \
		echo "$(MAKE) -C $$i clean"; $(MAKE) -C $$i clean; \
	     done; \
	fi

devolves to:

	@if [ -n "" ]; \
	then for i in ;do \
		echo "$(MAKE) -C $$i clean"; $(MAKE) -C $$i clean; \
	     done; \
	fi

And my shell complains that "for i in ;do" can't be parsed. I can
see that the goal of the test is not to execute this command if the
test fails, but the shell still has to parse it.

Is it just me? :-)

-- 
Norman.Walsh@East.Sun.COM | The average man, who does not know what to
XML Technology Center     | do with his life, wants another one which
Sun Microsystems, Inc.    | will last forever.--Anatole France

Re: parse error on extended element

Posted by Jerry Lawson <je...@virtualsummit.com>.
I got the change, and it works! thanks.
Now, the next problem: if I change the declaration of
ipAddress from the top-level to inside the ServiceTypeA complexType
(and remove ipAddress from the top-level), eg,


<complexType name="ServiceTypeA" base="test:ServiceBase"
derivedBy="extension">
   <element ref="test:subscriberId" minOccurs="1" maxOccurs="1"/>
   <element name="ipAddress" type="string" minOccurs="1" maxOccurs="1"/>
</complexType>

I get this error, reported from TraverseSchema.traverseElementDecl() :

org.xml.sax.SAXParseException: Schema error: Element ipAddress not found
in the Schema.


Again, not being a schema guru, this may be something that is
not legal in the April schema syntax.
This particular case is an example of other schemas declaring
subelements directly inside the complexType, rather than using
the 'ref'.

Any ideas ?

Eric Ye wrote:
> 
> Yes, that is a xsi:type bug that will happen only when the base type's
> content attribute has "empty" value.
> I've fixed it in the CVS, check out the
> org/apache/xerces/validators/common/XMLValidator.java to give it a try.

-- 
___________________________________________________
Jerry Lawson                   Virtual Summit, Inc.
Virtual Programmer   jerry.lawson@virtualsummit.com

Re: parse error on extended element

Posted by Eric Ye <er...@locus.apache.org>.
Yes, that is a xsi:type bug that will happen only when the base type's
content attribute has "empty" value.
I've fixed it in the CVS, check out the
org/apache/xerces/validators/common/XMLValidator.java to give it a try.
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

----- Original Message -----
From: "Jerry Lawson" <je...@virtualsummit.com>
To: <xe...@xml.apache.org>
Sent: Wednesday, October 25, 2000 11:19 AM
Subject: parse error on extended element


> I'm pretty new to validating xml against schema,
> and have run into a problem with my instance doc
> and schema. The problem reported by 1.2.1 xerces
> parser is:
>
> Error on line 12 of document file:test.xml: The content of element type
> "Service" must match "(subscriberId,ipAddress)"
>
> I have had the problem with more complicated schemas,
> but I've tried narrowing the scope of the problem with
> these simple files. I would like the schema to define
> a "base" type of Service, but allow for the instance
> docs to use extended types where Service is expected.
>
> Can anyone out there tell me what I'm doing wrong,
> syntax wise ?
>
>
> Here are my xml instance doc and schema:
>
> *****************************************
> test.xml:
>
> <?xml version="1.0"?>
>
> <Doc xmlns="http://www.jerry.org/test"
>      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
>      xsi:schemaLocation="http://www.jerry.org/test test.xsd"
>      version="1.0">
>
>      <Record seqNum="1">
>         <Service xsi:type="ServiceTypeA">
>            <subscriberId>Joe Blow</subscriberId>
>            <ipAddress>172.16.25.2</ipAddress>
>         </Service>
>      </Record>
> </Doc>
>
> ******************************************
>
> and, test.xsd:
>
> <?xml version="1.0"?>
>
> <schema xmlns="http://www.w3.org/1999/XMLSchema"
>         targetNamespace="http://www.jerry.org/test"
>         xmlns:test="http://www.jerry.org/test">
>
>
> <element name="Doc">
>   <complexType content="elementOnly">
>     <element ref="test:Record" minOccurs="1" maxOccurs="1"/>
>     <attribute name="version" type="string" minOccurs="1"
> maxOccurs="1"/>
>   </complexType>
> </element>
>
> <element name="Record">
>   <complexType content="elementOnly">
>     <choice minOccurs="0" maxOccurs="1">
>       <element ref="test:ipAddress"/>
>       <element ref="test:Service"/>
>     </choice>
>     <attribute name="seqNum" type="integer" use="optional"/>
>   </complexType>
> </element>
>
> <complexType name="ServiceBase" content="empty" final="restriction">
>   <attribute name="id" type="ID" use="optional"/>
> </complexType>
>
> <element name="Service" type="test:ServiceBase">
>   <annotation>
>     <documentation> This element describes the Service.
>     </documentation>
>   </annotation>
> </element>
>
> <complexType name="ServiceTypeA" base="test:ServiceBase"
> derivedBy="extension">
>    <element ref="test:subscriberId" minOccurs="1" maxOccurs="1"/>
>    <element ref="test:ipAddress" minOccurs="1" maxOccurs="1"/>
> </complexType>
>
> <element name="subscriberId" type="string">
>    <annotation>
>     <documentation> Subscriber's id.
>     </documentation>
>    </annotation>
> </element>
>
> <element name="ipAddress" type="string"/>
>
> </schema>
>
> --
> ___________________________________________________
> Jerry Lawson                   Virtual Summit, Inc.
> Virtual Programmer   jerry.lawson@virtualsummit.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>


parse error on extended element

Posted by Jerry Lawson <je...@virtualsummit.com>.
I'm pretty new to validating xml against schema,
and have run into a problem with my instance doc
and schema. The problem reported by 1.2.1 xerces
parser is:

Error on line 12 of document file:test.xml: The content of element type
"Service" must match "(subscriberId,ipAddress)"

I have had the problem with more complicated schemas,
but I've tried narrowing the scope of the problem with
these simple files. I would like the schema to define
a "base" type of Service, but allow for the instance
docs to use extended types where Service is expected.

Can anyone out there tell me what I'm doing wrong,
syntax wise ?


Here are my xml instance doc and schema:

*****************************************
test.xml:

<?xml version="1.0"?>
 
<Doc xmlns="http://www.jerry.org/test"
     xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
     xsi:schemaLocation="http://www.jerry.org/test test.xsd"
     version="1.0">
 
     <Record seqNum="1">
        <Service xsi:type="ServiceTypeA">
           <subscriberId>Joe Blow</subscriberId>
           <ipAddress>172.16.25.2</ipAddress>
        </Service>
     </Record>
</Doc> 

******************************************

and, test.xsd:

<?xml version="1.0"?>
 
<schema xmlns="http://www.w3.org/1999/XMLSchema"
        targetNamespace="http://www.jerry.org/test"
        xmlns:test="http://www.jerry.org/test">
 
 
<element name="Doc">
  <complexType content="elementOnly">
    <element ref="test:Record" minOccurs="1" maxOccurs="1"/>
    <attribute name="version" type="string" minOccurs="1"
maxOccurs="1"/>
  </complexType>
</element>
 
<element name="Record">
  <complexType content="elementOnly">
    <choice minOccurs="0" maxOccurs="1">
      <element ref="test:ipAddress"/>
      <element ref="test:Service"/>
    </choice>
    <attribute name="seqNum" type="integer" use="optional"/>
  </complexType>
</element>
 
<complexType name="ServiceBase" content="empty" final="restriction">
  <attribute name="id" type="ID" use="optional"/>
</complexType>
 
<element name="Service" type="test:ServiceBase">
  <annotation>
    <documentation> This element describes the Service.
    </documentation>
  </annotation>
</element>
 
<complexType name="ServiceTypeA" base="test:ServiceBase"
derivedBy="extension">
   <element ref="test:subscriberId" minOccurs="1" maxOccurs="1"/>
   <element ref="test:ipAddress" minOccurs="1" maxOccurs="1"/>
</complexType>
 
<element name="subscriberId" type="string">
   <annotation>
    <documentation> Subscriber's id.
    </documentation>
   </annotation>
</element>
 
<element name="ipAddress" type="string"/>
 
</schema>

-- 
___________________________________________________
Jerry Lawson                   Virtual Summit, Inc.
Virtual Programmer   jerry.lawson@virtualsummit.com

Re: 'make clean'?

Posted by Arnaud Le Hors <le...@us.ibm.com>.
Looks to me like the simple fix is to quote $(DIRS) in the for loop too.
Could you confirm the following works Norman?

        @if [ -n "$(DIRS)" ]; \
        then for i in "$(DIRS)";do \
                echo "$(MAKE) -C $$i clean"; $(MAKE) -C $$i clean; \
             done; \
        fi
-- 
Arnaud  Le Hors - IBM Cupertino, XML Technology Group

Re: 'make clean'?

Posted by Barry Draper <ba...@informix.com>.
Norm-
You need to add a list end marker in the for loop so that the for statement
is valid and a test for the end marker to prevent the recursive call within
the loop.
It appears someone else saw this and did it for the "dirs" target in
xerces-j 1.1.3, but
not for the "cleandirs" target. I ran into the same problem, so you're not
alone.
Here's the fix for both dirs and cleandirs:


clean:: cleandirs
        @$(RM) *.class

dirs::
        @if [ -n "$(DIRS)" ]; \
        then for i in $(DIRS) __bogus__; do \
               if [ $$i != __bogus__ ] ; then \
                echo "$(MAKE) -C $$i"; $(MAKE) -C $$i; \
                fi \
             done; \
        fi

cleandirs::
        @if [ -n "$(DIRS)" ]; \
        then for i in $(DIRS) __bogus__; do \
               if [ $$i != __bogus__ ] ; then \
                echo "$(MAKE) -C $$i clean"; $(MAKE) -C $$i clean; \
                fi \
             done; \
        fi

Barry Draper
Informix Software, Inc.
Oakland, CA
Email: barry@informix.com

At 02:01 PM 10/25/00 -0400, you wrote:
>FAQ? I can't seem to 'make clean' using the CVS checkouts of Xerces on
>my Linux box. The problem is that in the recursive process if there
>are no more directories to clean, the following statement:
>
>	@if [ -n "$(DIRS)" ]; \
>	then for i in $(DIRS);do \
>		echo "$(MAKE) -C $$i clean"; $(MAKE) -C $$i clean; \
>	     done; \
>	fi
>
>devolves to:
>
>	@if [ -n "" ]; \
>	then for i in ;do \
>		echo "$(MAKE) -C $$i clean"; $(MAKE) -C $$i clean; \
>	     done; \
>	fi
>
>And my shell complains that "for i in ;do" can't be parsed. I can
>see that the goal of the test is not to execute this command if the
>test fails, but the shell still has to parse it.
>
>Is it just me? :-)
>
>-- 
>Norman.Walsh@East.Sun.COM | The average man, who does not know what to
>XML Technology Center     | do with his life, wants another one which
>Sun Microsystems, Inc.    | will last forever.--Anatole France
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>