You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Voytenko, Dimitry" <DV...@SECTORBASE.COM> on 2000/07/15 23:25:19 UTC

Some bugs

Hi,
I got some problems with Xalan XSLT-processor. It's just a pin to ass. I
don't know where can I report about them. Thay are:

1) I think it is an error in the module FuncFormatNumb.java. You just forgot
two brackets in the else clauses. It's shown bellow:
      //else
      if (null == formatter)
      {
        // Try for default decimal-format
        dfs = ss.getDecimalFormatElem(Constants.DEFAULT_DECIMAL_FORMAT);
        if (null == dfs)
          formatter = new java.text.DecimalFormat(patternStr);
        else <-------------- { // this one
          //formatter = new java.text.DecimalFormat(patternStr, dfs);
          formatter = new java.text.DecimalFormat();
          formatter.setDecimalFormatSymbols(dfs);
          formatter.applyLocalizedPattern(patternStr);
        }<------------------- // and this one

So when there is no any default dormat declaration in the XSL template, you
set null as a decimal-format-symbols to formatter. And there are some
problems (NaN, +INF, -INF, etc)

2) You have all getOutputXXXX methods (getOutputIndent, etc) but you don't
have any setOutputXXXX (I have no idea why)

3) In class XSLTEngineImpl you have the next method

    public void charactersRaw (char ch[], int start, int length)
      throws SAXException
    {
      m_mustFlushStartDoc = true;
      flushPending();
      /*
      if(m_flistener instanceof org.apache.xml.serialize.BaseSerializer)
      {
 
((org.apache.xml.serialize.BaseSerializer)m_flistener).characters(new
String( ch, start, length ), false, true);
      }
      else
      */
      if(m_flistener instanceof FormatterToXML)
<---------------------------------
      {
        ((FormatterToXML)m_flistener).charactersRaw(ch, start, length);
      }
      else if(m_flistener instanceof FormatterToDOM)
      {
        ((FormatterToDOM)m_flistener).charactersRaw(ch, start, length);
      }
      else
      {
        m_flistener.characters(ch, start, length);
      }
      if(null != m_traceListeners)
        fireGenerateEvent(new GenerateEvent(XSLTEngineImpl.this,
 
GenerateEvent.EVENTTYPE_CHARACTERS,
                                            ch, start, length));
    }


You test if m_flistener is instance if some class. It's OK but probably it
will be better to replace this test with interface test. I know your class
FormatterToXML implements RawCharacterHandler interface. You just can make
FormatterToDOM to implement the same interface and it will allow you to
write only
      if(m_flistener instanceof RawCharacterHandler)
      {
        ((RawCharacterHandler)m_flistener).charactersRaw(ch, start, length);
      }
and it will allow me just implement the same interface for my own class, not
to extend whole FormatterToXML.

Thank you very much,

Dmytro E. Voytenko
Software Engineer
SECTORBASE.com, San Francisco, CA



BUG: Xalan does not allow >1 prefixes on an element for a given namespace URI

Posted by Jonathan Borden <jo...@openhealth.org>.
This bug results in the production of output XML documents which are NOT XML
Namespace compliant.

In some cases it is desirable to define a namespace prefix and default
namespace on the same element, e.g.

<xsl:stylesheet ..
<opnote:opnote xmlns="http://www.openhealth.org/opnote"
	xmlns:opnote="http://www.openhealth.org/opnote">
...
</opnote:opnote>

when transformed in Xalan:

<opnote:opnote xmlns="http://www.openhealth.org/opnote">
...
</opnote:opnote>

this document does not define the "opnote" namespace prefix.

Testing this under a variety of conditions (i.e. all that I can think of)
yeilds the finding that only the first prefix of a given namespace URI get
defined on a single element.

Jonathan Borden
The Open Healthcare Group
http://www.openhealth.org