Tatu, The bad namespace-awareness default is a gotcha that many users of JAXP eventually hit. Always needs to be set to true explicitly. XSLT, XPath, XML Schema, XInclude and many others require namespace support. Without it the behaviour is often undefined. There are no guarantees on what you get when it's missing.
Thanks. Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: mrgla...@ca.ibm.com E-mail: mrgla...@apache.org Tatu Saloranta <cowtownco...@yahoo.com> wrote on 02/06/2009 08:10:26 PM: > Ok: I figured it out; it is in fact a problem with namespace- > awareness settings. Default setting for SAX parsers constructed via > JAXP SAXParserFactory is (I think) non-namespace-aware. If I > explicitly set namespace-awareness on factory, things work ok. > I don't know if there is a bug in some part of ns-awareness > detection between Xalan and Xerces (or maybe a "feature"? :) ), but > explicitly setting it avoids these problems. > > -+ Tatu +- > > ps. apologies if this is a FAQ entry; I tried searching FAQ but > didn't see a mention > > --- On Fri, 2/6/09, Tatu Saloranta <cowtownco...@yahoo.com> wrote: > > > From: Tatu Saloranta <cowtownco...@yahoo.com> > > Subject: Problem: xalan dropping element names with transformations? > > To: xalan-j-users@xml.apache.org > > Date: Friday, February 6, 2009, 6:05 PM > > This sounds like something I am doing wrong, but I > > couldn't quite figure it out. Basically, I am running > > very simple test xsl transformations with Xalan & Xerces > > (including what amounts to identity transformation, i.e. > > just copies input nodes as is), but the output is missing > > element names. > > This seems to happen when explicity passing XMLReader > > constructed from xerces via SAXParserFactory; but if I use > > another SAX parser (non-xerces), result does contain > > (prefixed) element names as expected. > > > > My first guess was that perhaps this had something to do > > with versions of xercesImpl and serializer; but downgrading > > (from Xerces 2.9.1 and matching serializer) didn't > > resolve the problem. > > > > Or could it be some mixup between SAX parser settings; I > > remember that whethere prefixed-names are reported depends > > on some of settings. > > Hmmh. Maybe I need to play with namespace-awareness > > settings. > > > > -+ Tatu +-