Toshihiko Makita | 1 Nov 2007 15:33
Picon
Favicon
Gravatar

Invalid IDREF attribute error

Hello!

I'm using Xercces-J 2.9.1.

I tried to validate the XML document that have two invalid IDREF type
attribute 'xref' elements.

 <para>This is a test.<xref linkend="aaa"/><xref linkend="bbb"/></para>

But Xeces reports only one error.

 'An element with the identifier "bbb" must appear in the document.'

Why Xerces does not report all of the unresolved IDREFs? Is this the
limitation?

Any suggestions are welcome.

Thanks,

Toshihiko Makita
Amisha Popat | 1 Nov 2007 22:07
Picon

Regarding XML Schema on Linux

Hi,

I have an xml for which I have written the XSD. The validation code is my servlet. My XML is not able to locate my XSD. They both are in the same directory.
The servlet contains the method name validateCurrenciesXML which contains the validation code.
The app server is weblogic. My classpath contains xerces.jar. JDK version is j2sdk1.4.2_13
 
Please find attached all the requried files.

Please help

Thanks & Regards,

Amisha

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

<!--
	Currencies.xml
	
	This is the XML Schema used by Currencies.xml
	
	Author:  Amisha Popat

-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
	targetNamespace="http://www.ups.com/CurrenciesSchema"
	xmlns:tns="http://www.ups.com/CurrenciesSchema">
	
 
<xs:element name="currencies" type="Currencies"/>

 <xs:complexType name="Currencies" >
  <xs:sequence>
   <xs:element name="currency" type="CurrencyType" minOccurs="1" maxOccurs="unbounded"/>
  </xs:sequence> 
 </xs:complexType>
 
 <xs:complexType name="CurrencyType" >
  	<xs:attribute name="description" type="xs:string" use="required"/>
    <xs:attribute name="alpha" type="xs:string" use="required"/> 
  	<xs:attribute name="numeric" type="xs:string" use="required"/>
  	<xs:attribute name="decimalPlaces" type="xs:integer" use="required"/>  
 </xs:complexType>
        
     
</xs:schema>


Attachment (currencies.xml): text/xml, 4401 bytes
package com.ups.paymentcomponent;

import javax.servlet.http.*;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import java.io.*;
import java.util.*;

import com.ups.webappcommon.logging.log4jcompatible.*;
import com.ups.paymentcomponent.fdmspaymancassette.PCSConfigurator;
import org.apache.commons.digester.*;
import org.apache.commons.collections.*;
import com.ups.paymentcomponent.fdmspaymancassette.Client;
import com.ups.paymentcomponent.fdmspaymancassette.ClientCurrency;
import com.ups.paymentcomponent.fdmspaymancassette.ClientCard;

import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.helpers.XMLReaderFactory;
import org.xml.sax.SAXParseException;

public class PCSCurrencyServlet extends HttpServlet
{
	public static final Logger logger = Logger.getLogger
	("com.ups.paymentcomponent.PCSCurrencyServlet");
	private static HashMap cardAllow = new HashMap();
	private static HashMap cardDeny = new HashMap();
	private static Enumeration enumAllow;

	PCSConfigurator clientConfigurations = null;	
	String clientConfigDir = null;			
	String currenciesConfigFile = null;	
	String currenciesXsdFile = null;
	//Variables added for validating the XML through Schema
	String parserClass = "org.apache.xerces.parsers.SAXParser";
    String validationFeature
       = "http://xml.org/sax/features/validation";
    String schemaFeature
       = "http://apache.org/xml/features/validation/schema";

	public void init(ServletConfig sc) throws ServletException	
	{	
		try
		{						
			logger.log(UPSLevel.INFO,"Begin CurrencyServlet Initializing Payment Server");			

			Properties props = new Properties();
			props.load(new FileInputStream(System.getProperty(("pcs.currencyservlet.config.file"))));
			clientConfigDir = props.getProperty("clientConfigDir");
			currenciesConfigFile = props.getProperty("currenciesConfigFile");	
			currenciesXsdFile = props.getProperty("currenciesXsdFile");
			logger.log(UPSLevel.INFO, "testing the schema validation");
			//Method invoked to validate the currecies.xml file.
			validateCurrenciesXML(currenciesConfigFile);
			//Method invoked to validate the client Config xml files.
			validateClientXML();
			readClientConfigData();
			readCurrencies();
			clientConfigurations.setFast();									 		 			
			Properties propAllow = new Properties();
			Enumeration enumAllow = propAllow.keys();
			List allowList;	
			propAllow.load(new FileInputStream(System.getProperty("pcs.cards.allow.file")));

			while (enumAllow.hasMoreElements()) {
				String propName = (String) enumAllow.nextElement();
				String tmp = (String)propAllow.getProperty(propName);
				allowList = new ArrayList();
				StringTokenizer st = new StringTokenizer(tmp, ":");
				cardAllow.put(propName, allowList);
				while (st.hasMoreTokens()) allowList.add(st.nextToken());
			}
			Properties propDeny = new Properties();
			Enumeration enumDeny = propDeny.keys();
			List denyList;
		
			propDeny.load(new FileInputStream(System.getProperty("pcs.cards.deny.file")));

			while (enumDeny.hasMoreElements()) {
				String propName = (String) enumDeny.nextElement();
				String tmp = (String)propDeny.getProperty(propName);
				denyList = new ArrayList();
				StringTokenizer st = new StringTokenizer(tmp, ":");
				cardDeny.put(propName, denyList);
				while (st.hasMoreTokens()) denyList.add(st.nextToken());
			}

			logger.log(UPSLevel.INFO,"End Servlet Initializing Payment Server");
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}						
	}	

	public void doGet(HttpServletRequest req,HttpServletResponse resp)
	throws ServletException,java.io.IOException	
	{
		PrintWriter out = null;
		String cr = "\r\n"; 
		StringBuffer dtd = new StringBuffer();
		try
		{	
			out = resp.getWriter();   			  			
			dtd.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + cr);
			dtd.append("<!DOCTYPE merchantdata [<!ELEMENT merchantdata (currency)*>" + cr);
			dtd.append("<!ELEMENT currency (code,codeAlpha,floorlimit,decimalPlaces,cards)*>" + cr);		    
			dtd.append("<!ELEMENT code (#PCDATA)>" + cr);	
			dtd.append("<!ELEMENT codeAlpha (#PCDATA)>" + cr);			    
			dtd.append("<!ELEMENT floorlimit (#PCDATA)>" + cr);		
			dtd.append("<!ELEMENT decimalPlaces (#PCDATA)>" + cr);		    
			dtd.append("<!ELEMENT cards (cardtype+)>" + cr);		    
			dtd.append("<!ELEMENT cardtype (#PCDATA)>" + cr);
			dtd.append("<!ATTLIST cardtype" + cr);
			dtd.append("  merchantid CDATA #REQUIRED" + cr);
			dtd.append(">" + cr);
			dtd.append("]>" + cr);   

			Client c = clientConfigurations.getClient(req.getParameter("applicationId"));

			if (c == null)
			{
				throw new Exception("Invalid Client");	
			}

			String country = req.getParameter("country");

			StringBuffer sb = new StringBuffer();

			Vector clientCurrs = c.getCurrencies();
			int cSize = clientCurrs.size();


			sb.append("<merchantdata>" + cr);					
			for (int j=0;j<cSize;j++)
			{					
				sb.append("<currency>" + cr);
				ClientCurrency curr = 
					(ClientCurrency)clientCurrs.elementAt(j);

				sb.append
				("<code>" + 
						clientConfigurations.getCurrencyNumeric
						(curr.getAlphaCode())
						+ "</code>" + cr);							

				sb.append("<codeAlpha>" + curr.getAlphaCode() + 
						"</codeAlpha>" + cr);									

				sb.append("<floorlimit>" + curr.getFloorLimit() +
						"</floorlimit>" + cr);																												

				sb.append("<decimalPlaces>" + 
						clientConfigurations.getCurrencyDecimalPlaces
						(curr.getAlphaCode()) +
						"</decimalPlaces>" + cr);

				Vector cards = curr.getCards();
				Vector temp = new Vector();
				int cardsSize = cards.size();

				sb.append("<cards>" + cr);
				for (int x=0;x<cardsSize;x++)
				{									
					ClientCard cc = (ClientCard)cards.elementAt(x);
					
					//RFC 3259 - Added Country
					boolean allowCard = false;
					if (country == null) {
						allowCard = true;
					}
					else {
						List allow = (List)cardAllow.get(cc.getName());
						List deny = (List)cardDeny.get(cc.getName());
						/*
						 * Filter the card list by country.
						 * If there is NOT an allow list for the card, or there is an allow list for the card and the country 
						 * matches then return the card.
						 * However, if there is NOT a deny list for the card, or there is a deny list for the card, 
						 * and the country matches then do NOT return the card.
						 */
						if (((allow == null) || allow.contains(country) ) 
								&& ((deny == null) || !(deny.contains(country))) ) {
							allowCard = true;
						}
					}

						sb.append("<cardtype>");
						sb.append(cc.getName() + " merchantid=");
						if (!allowCard) {
							sb.append("XXXXXXXXXXX");
						}
						else if (cc.getEnabled())
						{
							sb.append("00000000000");
						}		
						else
						{
							sb.append("ZZZZZZZZZZZ");
						}
						sb.append("</cardtype>" + cr);
				
				}
				sb.append("</cards>" + cr);		
				sb.append("</currency>" + cr);
			}
			sb.append("</merchantdata>" + cr);	

			out.print(dtd.toString());
			out.print(sb.toString());	    		    		    
			out.close();	
		}
		catch(Exception e)
		{ 			
			StringBuffer sb = new StringBuffer();

			sb.append("<merchantdata>" + cr);
			sb.append("</merchantdata>" + cr);

			out.print(dtd.toString());
			out.print(sb.toString());   		

			logger.log
			(UPSLevel.SEVERE,"doGet() Error: " + e.toString());		   			
		}
	}	
	
	void readClientConfigData() throws Exception
	{
		try
		{
			clientConfigurations = new PCSConfigurator();
			File configDir = new File(clientConfigDir);
			if (configDir.isDirectory())
			{
				String [] clientConfigFiles = configDir.list();

				for (int i=0;i<clientConfigFiles.length;i++)
				{
					File temp = new File
					(clientConfigDir,clientConfigFiles[i]);

					if (temp.isFile() && temp.getName().endsWith(".xml"))
					{
						Digester digester = new Digester();	
						digester.push(clientConfigurations);

						digester.addObjectCreate("clientdata/client",
						"com.ups.paymentcomponent.fdmspaymancassette.Client");
						digester.addSetProperties("clientdata/client");
						digester.addSetNext
						("clientdata/client","addClient",
						"com.ups.paymentcomponent.fdmspaymancassette.Client");													

						digester.addObjectCreate("clientdata/client/currency",
						"com.ups.paymentcomponent.fdmspaymancassette.ClientCurrency");				
						digester.addSetProperties("clientdata/client/currency");
						digester.addSetNext
						("clientdata/client/currency","addClientCurrency",
						"com.ups.paymentcomponent.fdmspaymancassette.ClientCurrency");

						digester.addCallMethod("clientdata/client/currency/floorLimit","setFloorLimit", 1);	
						digester.addCallParam("clientdata/client/currency/floorLimit",
0);					

						digester.addCallMethod("clientdata/client/currency/divisionNumber","setDivisionNumber", 1);	
						digester.addCallParam("clientdata/client/currency/divisionNumber", 0);									

						digester.addObjectCreate("clientdata/client/currency/cards/cardType",
						"com.ups.paymentcomponent.fdmspaymancassette.ClientCard");				
						digester.addSetProperties("clientdata/client/currency/cards/cardType");
						digester.addSetNext
						("clientdata/client/currency/cards/cardType","addClientCard",
						"com.ups.paymentcomponent.fdmspaymancassette.ClientCard");				

						logger.log(UPSLevel.INFO,"Digesting " + temp);

						digester.parse(new FileInputStream(temp));					
					}									
				}
				clientConfigurations.setFast();
			}		
		}
		catch(Exception e)
		{		
			logger.log
			(UPSLevel.SEVERE,"Error retrieving client config data: " + e.toString());		
		}			
	} 

	
	void readCurrencies() throws CCAuthorizationException
	{
		try
		{
			Digester digester = new Digester();	
			digester.push(clientConfigurations);

			digester.addCallMethod("currencies/currency","addCurrency", 4);	
			digester.addCallParam("currencies/currency", 0,"description");		
			digester.addCallParam("currencies/currency", 1,"alpha");		
			digester.addCallParam("currencies/currency", 2,"numeric");		    		        		    
			digester.addCallParam("currencies/currency", 3,"decimalPlaces");		    		        		    

			digester.parse(new FileInputStream(currenciesConfigFile));		
		}
		catch(Exception e)
		{
			e.printStackTrace();

			logger.log
			(UPSLevel.SEVERE,"Error retrieving currency data: " + e.toString());		
		}	
	}		
	
	//Method added for validating currecies.XML file with schema
	private void validateCurrenciesXML(String currencyFile) throws Exception
	{
		logger.log(UPSLevel.INFO,"validateCurrenciesXML method is invoked:");
		      
	      try {
	      	 XMLReader r = XMLReaderFactory.createXMLReader(parserClass);
	         r.setFeature(validationFeature,true);
	         r.setFeature(schemaFeature,true);
	         //r.setErrorHandler(new XmlErrorHandlerException());
	         logger.log(UPSLevel.INFO,"properties are to be set");
	        // r.setProperty("http://apache.org/xml/properties/external-NamespaceScemaLocation",
	        	// "http://www.ups.com http://www.ups.com/currenciesXsdFile");
	         logger.log(UPSLevel.INFO,"properties are set");
	         r.parse(currencyFile);
	         logger.info("Currencies File"+ currencyFile.toString());
	         logger.log(UPSLevel.INFO, "Parse of the Currencies file is completed");
	      } catch (SAXParseException e) {
	    	 logger.log(UPSLevel.INFO, "SaxException thrown for currency file"); 
	    	 logger.log(UPSLevel.INFO,"   Public ID: "+e.getPublicId());
	         logger.log(UPSLevel.INFO,"   System ID: "+e.getSystemId());
	         logger.log(UPSLevel.INFO,"   Line number: "+e.getLineNumber());
	         logger.log(UPSLevel.INFO,"   Column number: "+e.getColumnNumber());
	         logger.log(UPSLevel.INFO,"   Message: "+e.getMessage());;
	      } catch (IOException e) {
	    	  logger.log(UPSLevel.INFO, "IOException thrown for currency file");
	    	  logger.log(UPSLevel.SEVERE,e.toString());
	      }
	     
	}

	//Method added for validating client config XML files with schema
	private void validateClientXML() throws Exception
	{
		logger.log(UPSLevel.INFO,"validateClientXML method is invoked:");
		File SingleXmlFile = null;    
	      try {
	    	  	File configDir = new File(clientConfigDir);
	  			if (configDir.isDirectory())
	  			{
	  				String [] clientConfigFiles = configDir.list();

	  				for (int i=0;i<clientConfigFiles.length;i++)
	  				{
	  					SingleXmlFile = new File
	  					(clientConfigDir,clientConfigFiles[i]);

	  					if (SingleXmlFile.isFile() && SingleXmlFile.getName().endsWith(".xml"))
	  					{
					      	 XMLReader r = XMLReaderFactory.createXMLReader(parserClass);
					         r.setFeature(validationFeature,true);
					         r.setFeature(schemaFeature,true);
					         //r.setErrorHandler(new XmlErrorHandlerException());
					         r.parse(SingleXmlFile.toString());
					         logger.log(UPSLevel.INFO,"Parsing of " + SingleXmlFile.getName()+ " file is completed");
	  					}
	  				}
	  			}
	  			} catch (SAXParseException e) {
	  				logger.log(UPSLevel.INFO, "SaxException thrown for " + SingleXmlFile.getName()+ "client file");
	  				logger.log(UPSLevel.INFO,"   Public ID: "+e.getPublicId());
	  		        logger.log(UPSLevel.INFO,"   System ID: "+e.getSystemId());
	  		        logger.log(UPSLevel.INFO,"   Line number: "+e.getLineNumber());
	  		        logger.log(UPSLevel.INFO,"   Column number: "+e.getColumnNumber());
	  		        logger.log(UPSLevel.INFO,"   Message: "+e.getMessage());
			    } catch (IOException e) {
			    	logger.log(UPSLevel.INFO, "IOException thrown for client file");
			      logger.log(UPSLevel.SEVERE,e.toString());
			    }
	}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe <at> xerces.apache.org
For additional commands, e-mail: j-users-help <at> xerces.apache.org
Amanda Abbey | 1 Nov 2007 22:36

RE: Regarding XML Schema on Linux

One problem I see, although the code is commented out:

http://apache.org/xml/properties/external-NamespaceScemaLocation has a spelling error. Should be “SchemaLocation” when setting the property of your reader factory.

Amanda

 

From: Amisha Popat [mailto:amisha.popat <at> gmail.com]
Sent: Thursday, November 01, 2007 5:07 PM
To: xerces-j-user <at> xml.apache.org
Subject: Regarding XML Schema on Linux

 

Hi,

I have an xml for which I have written the XSD. The validation code is my servlet. My XML is not able to locate my XSD. They both are in the same directory.

The servlet contains the method name validateCurrenciesXML which contains the validation code.

The app server is weblogic. My classpath contains xerces.jar. JDK version is j2sdk1.4.2_13

 

Please find attached all the requried files.

Please help

Thanks & Regards,

Amisha

Jacob Kjome | 2 Nov 2007 07:24
Favicon

Re: Regarding XML Schema on Linux


Look into using an EntityResolver [1].  Your schemaLocation points to a URL that 
doesn't resolve.  You need to map that URL to a local resource.  That's what the 
EntityResolver is for.

[1] http://java.sun.com/j2se/1.4.2/docs/api/org/xml/sax/EntityResolver.html

Jake

Amisha Popat wrote:
> Hi,
> 
> I have an xml for which I have written the XSD. The validation code is 
> my servlet. My XML is not able to locate my XSD. They both are in the 
> same directory.
> The servlet contains the method name validateCurrenciesXML which 
> contains the validation code.
> The app server is weblogic. My classpath contains xerces.jar. JDK 
> version is j2sdk1.4.2_13
>  
> Please find attached all the requried files.
> 
> Please help
> 
> Thanks & Regards,
> 
> Amisha
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe <at> xerces.apache.org
> For additional commands, e-mail: j-users-help <at> xerces.apache.org
Thomas Porschberg | 2 Nov 2007 06:05
Picon

error check in sample SAXWriter

Hello Xercianer,

I have to validate a XML file against a XSD and tried the java version 
of xerces for this task.
I simply installed Xerces (2.8) and the sample-jar  and called

java sax.Writer -v -f -s foo.xml 1>/dev/null | grep Error

I'm not interested in the output. Because I'm on Unix I redirect
the output to /dev/null and I grep  stderr for "Error" to detect
all kind of errors. If the return code of grep is 0 then the XML file
is not valid.

My questions: 
1. Is there a better java-xerces "tool" for doing that task
    (something like xmllint in java) ?
    (I missed the possibility to suppress the output via a command line
     switch.)
2. Is it reliable to grep for Error in stderr ? Are there situations there no
    Error-line is printed but the XML is still corrupt ?
    (The C++ version of Xerces comes with samples too and when I call
     SAX2Print ... I'm able to detect validation/parse errors via the return code
     of the program. This seems not the case with the java version.)

Best regards,
Thomas

--

-- 
http://www.randspringer.de
Michael Glavassevich | 2 Nov 2007 22:01
Picon

Re: complexType with simpleContent facet violation message not helpful

Hi Ron,

We weren't assigning an anonymous type name to the simple type. I just
committed a fix for that. If you pickup the current code from SVN you
should get "#AnonType_Comment2Type" instead of "null" as the type name in
the error message.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas <at> ca.ibm.com
E-mail: mrglavas <at> apache.org

Ron Gavlin <rgavlin <at> yahoo.com> wrote on 10/30/2007 04:58:01 PM:

> I have a maxLength facet on a complexType with simpleContent that
> extends a base complexType. Schema validation performed by the
> included program with the included schemas & xml file results in the
> stack trace listed below. Note the message refers to the relevant
> anonymous type as [type 'null'] which is not helpful. In this case,
> a more helpful error message would refer to either the complexType
> name itself or its base type name. Should I open a JIRA for this issue?
>
> STACK TRACE:
>
> org.xml.sax.SAXParseException: cvc-maxLength-valid: Value '
>         commentZZZZZZZZZZZZZZZZZZ
>     ' with length = '30' is not facet-valid with respect to
> maxLength '20' for type 'null'.
>     at org.apache.xerces.util.ErrorHandlerWrapper.
> createSAXParseException(Unknown Source)
>     at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
>     at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
>     at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
>     at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)

<snip/>

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe <at> xerces.apache.org
> For additional commands, e-mail: j-users-help <at> xerces.apache.org
Michael Glavassevich | 2 Nov 2007 22:27
Picon

Re: Invalid IDREF attribute error

Hi Toshihiko,

This is currently a limitation. The class Xerces uses for checking ID/IDREF
is only capable of returning the first IDREF found without a matching ID
value.

Thakns.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas <at> ca.ibm.com
E-mail: mrglavas <at> apache.org

Toshihiko Makita <tmakita <at> antenna.co.jp> wrote on 11/01/2007 10:33:52 AM:

> Hello!
>
> I'm using Xercces-J 2.9.1.
>
> I tried to validate the XML document that have two invalid IDREF type
> attribute 'xref' elements.
>
>  <para>This is a test.<xref linkend="aaa"/><xref linkend="bbb"/></para>
>
> But Xeces reports only one error.
>
>  'An element with the identifier "bbb" must appear in the document.'
>
> Why Xerces does not report all of the unresolved IDREFs? Is this the
> limitation?
>
> Any suggestions are welcome.
>
> Thanks,
>
> Toshihiko Makita
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe <at> xerces.apache.org
> For additional commands, e-mail: j-users-help <at> xerces.apache.org
Michael Glavassevich | 2 Nov 2007 23:05
Picon

Re: error check in sample SAXWriter

Hi Thomas,

The sample registers an ErrorHandler which prints every error reported to
it to System.err; each line prefixed with "[Fatal Error]", "[Error]" or
"[Warning]". If you grep for those you should catch every error / warning
emitted by the parser. The regular output from the sample is written to
System.out. You cannot suppress it unless you wrap your own program around
it which redirects the output elsewhere. There's no command line switch for
that.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas <at> ca.ibm.com
E-mail: mrglavas <at> apache.org

Thomas Porschberg <thomas <at> randspringer.de> wrote on 11/02/2007 01:05:28 AM:

> Hello Xercianer,
>
> I have to validate a XML file against a XSD and tried the java version
> of xerces for this task.
> I simply installed Xerces (2.8) and the sample-jar  and called
>
> java sax.Writer -v -f -s foo.xml 1>/dev/null | grep Error
>
> I'm not interested in the output. Because I'm on Unix I redirect
> the output to /dev/null and I grep  stderr for "Error" to detect
> all kind of errors. If the return code of grep is 0 then the XML file
> is not valid.
>
> My questions:
> 1. Is there a better java-xerces "tool" for doing that task
>     (something like xmllint in java) ?
>     (I missed the possibility to suppress the output via a command line
>      switch.)
> 2. Is it reliable to grep for Error in stderr ? Are there situations
there no
>     Error-line is printed but the XML is still corrupt ?
>     (The C++ version of Xerces comes with samples too and when I call
>      SAX2Print ... I'm able to detect validation/parse errors via
> the return code
>      of the program. This seems not the case with the java version.)
>
> Best regards,
> Thomas
>
> --
> http://www.randspringer.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe <at> xerces.apache.org
> For additional commands, e-mail: j-users-help <at> xerces.apache.org
Michael Glavassevich | 5 Nov 2007 14:58
Picon

Fw: MarkMail: hosting Apache mailing list archives


FYI ...

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas <at> ca.ibm.com
E-mail: mrglavas <at> apache.org

Jason Hunter <jhunter <at> acm.org> wrote on 11/04/2007 10:56:51 PM:

> PMCs, could you please send this announcement to your various users <at>  and
> devs <at>  mailing lists, as appropriate for your particular community.
>
> And please, if you think it proper, add a link to MarkMail on your
> project web site as an option for searching your project's email
> archives.  You can point to http://<project>.markmail.org.
>
> ----
>
> (A forwarded email from Jason Hunter)
>
> For the last few months I've been working on a new project: a web
> site for interacting with email archives.  We're using, as the
> site's initial content set, the public Apache mailing list archives
> -- because Apache is the community I know best and I think people
> here will find the site useful.  We've loaded a bit over 4,000,000
> emails across 500 lists.
>
> http://apache.markmail.org
>
> As you'll see with the chart on the home page, one of our goals with
> the site has been to focus heavily on analytics.  We have lots of
> graphs and counts, and you're able to use them to watch Apache's
> historical growth and each individual project's growth.  Every query
> you write gets its own histogram chart.
>
> Another goal has been interactivity.  Every search result screen gives
> you lots of ways to refine your search (by sender, list, attachment
> type, etc).  Plus we did a lot with keyboard shortcuts.  You can hit
> "n" and "p" to move to the next and previous result and "j" and "k" to
> move up and down the thread view.  There's a lot of little things like
> this.  Plus if your result message includes Office or PDF files
> they're in-line interactive too.
>
> http://apache.markmail.org/search/ext:ppt+axis
>
> Another goal has been to focus on community.  We could have launched
> MarkMail with 50,000,000 emails from many sources but I think it's
> better to start with focus.  In fact, I'll be at ApacheCon and the
> Hackathon next week, along with my co-developer Ryan Grimm,
> looking for people's suggestions and maybe on the spot adding in a
> few of them.  There's also potential to explore some fun one-off
> analytics, too.
>
> As part of the focus on communities, we setup MarkMail so it
> recognizes that Apache itself consists of many communities.  If you go
> to http://apache.markmail.org you search all Apache emails, but if you
> go to http://struts.markmail.org then you're auto-limited to just
> Struts lists.  Same for tomcat, spamassassin, httpd, and so on.  You
> can always limit your search using "list:struts" in your query, but
> using the domain handles that a bit more elegantly.
>
> I've been working on this a long time, and I'm so happy to be able to
> share it with everyone.  I hope you all find this useful!
>
> Notes on using the site:
>
> * Search using keywords as well as from:, subject:, extension:, and
>    list: constraints
>
> * The GUI doesn't yet expose it, but you can negate any search item,
>    like -subject:jira.
>
> * You can sort results by date by adding order:date-forward or
>    order:date-backward to your query
>
> * Remember to use "n" and "p" keyboard shortcuts to navigate the search
>    results
>
> * You're going to want JavaScript enabled
>
> If you'd like to send me private feedback I'm jhunter at apache dot org.
>
> -jh-
Michael Glavassevich | 5 Nov 2007 15:26
Picon

Re: jar conflict causing java.lang.VerifyError

Hi,

There's no release of Xerces which has both of those classes. Looks like
you have copies of Xerces-J 1.x and 2.x on your classpath so it wouldn't
surprise me if you ran into compatibility problems. Try replacing whatever
jars you're using with the latest release [1].

Thanks.

[1] http://xerces.apache.org/xerces2-j/download.cgi

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas <at> ca.ibm.com
E-mail: mrglavas <at> apache.org

bhodig <brian.holecko <at> dig.com> wrote on 11/02/2007 05:02:21 PM:

> Hi, I am using xerces.jar and xerces-export.jar together which is causing
the
> following exception:
>
> java.lang.VerifyError: (class: [my class name here], method:
executeService
> signature: (Ljava/lang/String;)Lorg/w3c/dom/Document;) Incompatible
object
> argument for function call
>
> When I remove either jar from my classpath I get a ClassNotFoundException
> respectively:
>
> xerces.jar:
> org/apache/xerces/parsers/AbstractDOMParser
>
> xerces-export.jar:
> org/apache/xerces/framework/XMLParser
>
> Does anybody know of a jar that contains both of these classes?  Also, I
> can't find the location of a jar that contains
> org/apache/xerces/framework/XMLParser on this site, so if anybody knows
> where that is located it would help.  Thanks!

Gmane