RE: OutOfMemory due to SymbolTable caching!

2005-03-17 Thread Joseph Kesselman
The only way I can see to create an intern (-like) table that discards values no longer in use is to use Weak References... __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed profoundly and unpredictably the day Tim Ber

Re: Resolving custom ID attributes

2005-03-11 Thread Joseph Kesselman
If the attribute is declared as an ID in the DTD, the normal operations will find it whether or not it is named "id". If it isn't, you get to implement your own solution... __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world ch

Re: Unexpected normalizing?

2005-03-10 Thread Joseph Kesselman
XPath's view of text nodes is that all adjacent text is a single node, whether or not it's divided up into multiple DOM nodes internally. __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed profoundly and unpredictably t

Re: XML Declaration

2005-02-14 Thread Joseph Kesselman
The XML Declaration must start at the very first character of the XML document being parsed -- if you have a blank line or space in front of it, fix that. (The one exception is that a two-byte Byte Order Mark may preceed the XML Declaration.) __ Joe Kesselma

Re: XML Declaration

2005-02-14 Thread Joseph Kesselman
Oracle is wrong. The XML Declaration is not a child in the DOM. Complain to them and see if they offer a mode which handles it properly. (The DOM had no standard API for the XML Declaration until DOM Level 3, which is part of why some parsers tried to cheat by turning it into a special node or

Re: SAX namespace processing

2005-01-14 Thread Joseph Kesselman
This depends on how you've configured your SAX processor. SAX can return namespace declarations as attributes (for compatability with SAX 1.0), or as BeginPrefixMapping/EndPrefixMapping events, or both. See http://www.saxproject.org/?selected=namespaces __

Re: Schema validate CDATA section

2005-01-06 Thread Joseph Kesselman
A section is just another way of writing text content. Schemas can validate the value of text against a datatype. They don't care whether it was written as a CDATA section or something else. __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL a

Re: Validate With Schema in CLASSPATH

2005-01-05 Thread Joseph Kesselman
On Wednesday, 01/05/2005 at 02:43 PST, Bob Foster <[EMAIL PROTECTED]> wrote: > > If we're doing our own URI support... why? > Why what? "Why are we doing so". Sorry, I thought that was self-evident from context. I agree I should have been clearer, especially since not all the participants here

Re: Validate With Schema in CLASSPATH

2005-01-05 Thread Joseph Kesselman
If we're using the Java URI support, I believe the jar: scheme is supported by that layer. If we're doing our own URI support... why? __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed profoundly and unpredictably t

Re: Socket timeout when parsing a big XML file (DOM/SAX)

2004-12-17 Thread Joseph Kesselman
Does your document reference a DTD or Schema located on the web, perhaps? __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed profoundly and unpredictably the day Tim Berners Lee got bitten by a radioactive spider."

DeferredDocumentImpl?

2004-12-14 Thread Joseph Kesselman
On Tuesday, 12/14/2004 at 01:09 GMT, "Alistair Young" > It seems to get > populated as you do things on it, such as getNodeName/getNodeValue etc. > For instance, after parsing, DeferredDocumentImpl.firstChild is sometimes > null, or points to a structure full of nulls. After calling > getNodeNa

Re: Why didn't XML provide a document separator?

2004-11-24 Thread Joseph Kesselman
>Because such a stream is not an XML document, I suppose. More or less. They had to stop at some point; Document is where they drew the line. There's nothing wrong with higher-level protocols when you have to transmit multiple documents; if it happens often enough, someone can propose a standa

RE: Java cannot parse what the DOM creates??

2004-11-24 Thread Joseph Kesselman
Re why #12; can't be converted back to ^L (formfeed): Unfortunately, the XML spec says that numeric character escapes are treated the same as their corresponding characters; if it isn't a legal XML 1.0 character, expressing it as a numeric is not a workaround. That's not a parser issue, it's an

Re: Java cannot parse what the DOM creates??

2004-11-22 Thread Joseph Kesselman
>This is a major design flaw in DOM. XOM does not not have this problem. :-) This is a major performance tradeoff deliberately accepted in the DOM. Checking every string every time would impose serious overhead on applications, completely unnecessarily in many cases since the structure of the

RE: Java cannot parse what the DOM creates??

2004-11-22 Thread Joseph Kesselman
Not all characters are legal in XML, so not all numeric character references are legal. The APIs don't generally check for illegal characters. Nor does the serializer. So it's possible for an application to build, and write out, a document which is not well-formed. Since you're looking at Cri

Re: Java cannot parse what the DOM creates??

2004-11-22 Thread Joseph Kesselman
Hm. rechecking the XML 1.1 spec, #12; (which is #xC;) is a Restricted Character... __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed profoundly and unpredictably the day Tim Berners Lee got bitten by a radioactive

Re: Java cannot parse what the DOM creates??

2004-11-22 Thread Joseph Kesselman
I presume you mean &12; -- the trailing semicolon is important. See the XML Specification's description of "numeric character references". This is absolutely standard XML. Any parser *should* accept it unless it appears in a place where that character is not legal (in the middle of an element

Re: pull?

2004-10-25 Thread Joseph Kesselman
There is limited pull support already in Xerces if you work at the XNI level. (Actually, it's closer to "burst push".) My solution when I needed a true event-by-event pull parser was to wrap the SAX invocations in a coroutine-based "throttle" -- run the parser and app in different threads and

Re: ID type attributes losing type

2004-10-21 Thread Joseph Kesselman
Check with the DOM WG to be sure, but I don't _think_ this is broken. Copying/cloning/importing attribute nodes in the DOM may lose ID-ness, since the attribute may not be an ID in the new location. Some DOMs may be able to check and reassert this, if they have the DTD/schema information avail

Re: Problem reading XML with XPath

2004-10-21 Thread Joseph Kesselman
XPath is namespace-sensitive. If you don't provide prefixes in your XPath, bound to namespaces via a PrefixResolver, it will not match namespaced nodes. (XPath 2.0 is planning to add support for default namespaces in XPath syntax, but that isn't available yet.) ___

Re: CatchedXPathAPI - multithreading implementation

2004-09-22 Thread Joseph Kesselman
CachedXPathAPI assumes that you are *NOT* going to change the source document(s) between path searches. If you do so, it's your responsibility to flush the cache by discarding the CachedXPathAPI object and obtaining a new one. (Or you could try the experimental DOM2DTM2 adapter, which attempts

Re: Problem with serialization of a DOM with xerces 2.6.2

2004-09-17 Thread Joseph Kesselman
We agree that we disagree. __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.   "The world changed profoundly and unpredictably the day Tim Berners Lee got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk

Re: Problem with serialization of a DOM with xerces 2.6.2

2004-09-16 Thread Joseph Kesselman
We agree that we disagree. DOM applications can and should be written to be able to operate successfully against a DOM that does not contain namespace declaration attributes. Not all have been, or have been updated to be so.. Then again, not all have been (re)written to be properly namespace-aware

Re: Problem with serialization of a DOM with xerces 2.6.2

2004-09-16 Thread Joseph Kesselman
I'm afraid that turns out not to be correct, Elliotte. The DOM does not require namespace declaration attributes to be present. They typically are produced when a parser builds the DOM,, but the DOM is designed to operate perfectly happily  without them.In that case, it is the responsibility of t

RE: SV: Reading entire tree structure of an XML

2004-08-27 Thread Joseph Kesselman
There are some comments on DOM versus SAX at http://www.w3.org/DOM/faq.html#SAXandDOM. It's slightly outdated, but remains essentially true. __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed profoundly and unpredic

Re: Checking the validity of URI for namespaces (targetNamespace)

2004-08-23 Thread Joseph Kesselman
Namespace URIs must be absolute URI references; the use of reletive references for this purpose has been deprecated. See http://www.w3.org/TR/xml-names11/#iri-use Note that the spec says "deprecated", not "forbidden". Some processors may still tolerate relative reference syntax as namespace na

Re: Special characters as question marks?

2004-08-19 Thread Joseph Kesselman
Are you sure the string contains the '?' character, rather than the tool you're using to display that character displaying it as '?'...? The former would be hard to explain; the latter is a fairly common problem. __ Joe Kesselman, IBM Next-Generation Web Tec

Re: Special characters in XML being validated against a schema

2004-08-17 Thread Joseph Kesselman
Alternatively, you can use an internal subset (DTD syntax inside the document itself, which keeps things self-contained)... or you skip the mnemonic names and just use numeric character references... or you skip those and just use the characters themselves and pick an encoding which supports

RE: non-xml to xml using transformations

2004-08-04 Thread Joseph Kesselman
I believe the XNI examples included a "parser" for CSV (comma-separated value) files, which is probably an easier-to-read starting point than NekoHTML. __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed profoundly a

Re: Parsing "aggregate" Xml documents

2004-07-28 Thread Joseph Kesselman
XML parsers aren't generally designed to extract sub-documents as such. You can achieve this result by running a single parse on the complete document and routing the output in appropriate directions -- eg, by having the parser feed a SAX processor which fans out the input to other SAX processo

Re: resolver.jar does not handle Windows file names

2004-05-28 Thread Joseph Kesselman
The resolver is expecting a URI, and a Windows file name is not a URI. Use

Re: How does document encoding affect DOMString character values in a resulting DOM? (possible Xerces bug)

2004-05-07 Thread Joseph Kesselman
The DOMString's internal encoding is always unicode, specifically UTF-16. The parser should convert from the XML text's encoding to that form; the serializer should convert to whatever output text encoding is being used. __ Joe Kesselman, IBM Next-Generation

Re: DOM Serializer and escaping

2004-05-05 Thread Joseph Kesselman
The > character does not really need to be escaped, since there's no situation in which it can be misintepreted. The ' character does not need to be escaped when it appears inside a string delimited by ". I suspect the effect of changing JVMs is that you're changing which version of Xerces y

Re: DTD being resolved using non-validating parser?

2004-05-03 Thread Joseph Kesselman
This should probably be added to the FAQ page of the website, y'know... __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed profoundly and unpredictably the day Tim Berners Lee got bitten by a radioactive spider." --

RE: Extending (subclassing) Elements

2004-03-04 Thread Joseph Kesselman
: was Joseph Kesselman/Watson/IBM received by

Re: sax and carriage returns

2004-03-04 Thread Joseph Kesselman
Most likely error: Remember that SAX does *NOT* promise that contiguous context text will be delivered as a single call to characters(). It may occur as several successive calls, for buffer management reasons. It's the application's responsibiltiy to deal with gluing it back together, if needed

Re: Read Processing Instruction

2004-02-26 Thread Joseph Kesselman
The XML Declaration is officially not considered a processing instruction, and can't be treated as one. DOM Level 3 is planning to add calls to retrieve information from the XML Declaration (xmEncoding, xmlStandalone, xmlVersion, inputEncoding), Xerces probably has a beta/prototype of that fu

RE: Help: Xerces 2.3 DeferredElementNSImpl.synchronizeData() throws NullPointer

2004-02-06 Thread Joseph Kesselman
localName will be null if the node is a Level 1 DOM node -- ie, was produced by a non-namespace-aware DOM builder, or by calling the semi-deprecated createElement/createAttribute/setAttribute methods rather than the new ...NS versions of those methods. __ Jo

Re: [OT] Character Sets (Was Re: ContentHander characters discrepancy)

2004-01-14 Thread Joseph Kesselman
>When I receive the xml file, it currently specifies a UTF-8 encoding.  Some >characters are invalid for UTF-8, so are interpreted based on the locale >settings of the operating system. If you specify an encoding, your document *MUST* conform to that encoding, or it is not a well-formed XML fi

RE: Validation feature problems redux

2004-01-06 Thread Joseph Kesselman
>What am I missing? Why is this URL approach a superior solution to setter methods? What you're missing is that this isn't just a Xerces API. It's shared with other parsers, which may support a different subset of features. Using a string-based approach to naming the features avoids having to

Validation feature problems redux

2004-01-06 Thread Joseph Kesselman
> > xsi:schemaLocation="http://www.bogus.com file://C:/xml/bogus.xsd"> file:/// - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Internal Xerces structure available?

2004-01-06 Thread Joseph Kesselman
The internal structure would be something like a DOM tree, which tends to take more bytes than the XML stream does... and object serialization/deserialization is often not a heck of a lot faster than XML parsing. Most of the proposals for "binary XML" representations have hit that same set of r

RE: How can you prevent DeferredTextImpl?

2003-12-19 Thread Joseph Kesselman
Note that the subject is misleading: The goal isn't to "prevent DeferredTextImpl", but to suppress text nodes which a specific application would prefer to ignore. If you just want to suppress whitespace-in-element-content as defined by the DTD, one of the parser features (http://apache.org/xml

RE: How can you prevent DeferredTextImpl?

2003-12-19 Thread Joseph Kesselman
Changing the DOM while using a NodeIteratorn is legal; the DOM Level 2 Traversers And Iterators specification is very explicit about what happens when you do that. There are some potential pitfalls, due to the iterator's "maintain current position in the document" behavioral model; I _strongly_

Re: Forbidden chars in attributes?

2003-12-16 Thread Joseph Kesselman
See the XML Recommendation for a list of which Unicode characters are and aren't legal in XML, and see the documentation for the encoding you're using for information about how what's in the file translates to Unicode and back. Unicode can represent almost any character, in almost any language

Re: newbie - trying examples, get error: java.lang.NoClassDefFoundError: sax/Counter

2003-12-08 Thread Joseph Kesselman
Yes, that's normal. Think of jarfiles as if they were directories; if you want to search them, they must be explicitly added to the classpath. (But that's a topic for a Java tutorial...) __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and mo

RES: Xerces 2.5 compat.

2003-11-21 Thread Joseph Kesselman
Note that there is an outstanding suggestion that Xalan consider finally abandoning JDK 1.1.8 support, in the hope that being allowed to use some of the classes added in 1.2 (the new collections, for example) might yield efficiency improvements. I don't know whether Xerces has been considering

Re: dynamic validation, is this a bug

2003-11-20 Thread Joseph Kesselman
> I want to validate that I got a Car and process the Car even though the Car was really a >CompanyXCar(ie. I am ignoring data from other namespaces) The standard solution for that is to have everyone agree on a base schema for Car and derive their customized CompanyXCars from that. Then Comp

Re: High memory usage with jdk1.4.x

2003-11-20 Thread Joseph Kesselman
Are you aware that JDK 1.3 and 1.4 come with relatively ancient versions of Xerces, and have you remembered to override that with the current code before running your tests? It isn't just a matter of setting the classpath, unfortunately. (The approaches we recommend for Xalan should work for X

RE: #text when parsing xml

2003-11-10 Thread Joseph Kesselman
Whitespace *IS* text in XML; see the XML spec. *IF* you are validating against a DTD (I'm not sure about schema), it is possible to have whitespace that occurs in places where only elements were expected marked as "whitespace in element content". (SAX, erroneously-but-uncorrectably, calls thi

RE: Serialization StackOverflowError

2003-11-10 Thread Joseph Kesselman
Just a general observation: Since it has parent links as well as sibling and child, a DOM can be walked non-recursively. It might be worth considering an interative implementation of the serializer and seeing how much stack that saves us and what its performance characteristics are. See the log

Re: appendNode() in DOM

2003-11-07 Thread Joseph Kesselman
Please see http://www.w3.org/DOM/faq.html#ownerdoc __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed profoundly and unpredictably the day Tim Berners Lee got bitten by a radioactive spider." -- Rafe Culpin, in r.m.

RE: multi-threaded issues on a multi-cpu machine

2003-10-29 Thread Joseph Kesselman
> Is there any thread-safe way to *read* a DOM from > multiple threads simultaneously? The only guaranteed-portable answer is to set up your own locks to ensure only one thread tries to access the DOM at a time. The DOM WG looked at this and decided that locking on individual DOM operations wa

Re: Node identifier

2003-10-28 Thread Joseph Kesselman
On Tuesday, 10/28/2003 at 09:59 PST, "Jeff Greif" <[EMAIL PROTECTED]> wrote: > A completely portable, low-tech, arms-length solution would be to construct > the document, then traverse it to construct one or both of the Maps, > Node->Id and Id->Node, assigning the Id as you go. Unfortunately,

Re: Node identifier

2003-10-28 Thread Joseph Kesselman
The most portable nonportable solution is probably to use the (DOM Level 3 prototype) userData hook to associate your own generated identifiers with each node. __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed prof

DOMImplementation

2003-10-28 Thread Joseph Kesselman
On Monday, 10/27/2003 at 11:16 EST, Ian Lewis <[EMAIL PROTECTED]> wrote: > I was wondering what classes currently use the DOMImplementation class in the > current working draft of DOM3. I'm not sure what question you're asking... DOMImplementation isn't new with DOM Level 3. > My thoughts are

Re: DOM parser problem with handling Windows UNC path for XML and DTD file

2003-09-10 Thread Joseph Kesselman
Try putting file:/// in front of the UNC path, to make it a legal local-directory-system URI... __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed profoundly and unpredictably the day Tim Berners Lee got bitten by a

Re: error: more pseudo attributes expected.

2003-08-13 Thread Joseph Kesselman
>Shouldn't the transformer see the '&' as a start of an entity reference when coming from a StringReader? Yes, assuming you also have the trailing ; to close the entity reference, and assuming the entity in question is defined in the DTD or internal subset. (And that the DTD is being resolved,

Re: error: more pseudo attributes expected.

2003-08-13 Thread Joseph Kesselman
If you want an entity reference, construct an Entity Reference node/event. If you use a & character in a data field, that's just data (equivalent to & in the XML source). __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world c

Re: AW: Creating a Document from a DocumentFragment or NodeList

2003-08-07 Thread Joseph Kesselman
>Where is this stated "officially"? In fact, I do seem to be confused. There's an explicit statement that the binding to the Document Type can't be altered, but there isn't a similar statement for the root element. __ Joe Kesselman, IBM Next-Generation Web

Re: AW: Creating a Document from a DocumentFragment or NodeList

2003-08-07 Thread Joseph Kesselman
Officially, the DOM doesn't currently allow you to replace the document element. (DOM Level 3 may relax that restriction), which makes this a bit more complicated if you want a fully portable solution. There may also be children of the Document other than the root element which would need to be

need help in entity resolution

2003-08-07 Thread Joseph Kesselman
On Thursday, 08/07/2003 at 06:36ZE10, "Raveendranath, Rohith (LNG - AUS)" > ″ ′ and say one more enity — These are numeric character references, not entity references. They don't have to be defined (and in fact can't be defined); they map directly into the Unicode characters with those numbe

Re: Creating a Document from a DocumentFragment or NodeList

2003-08-06 Thread Joseph Kesselman
Use DOMImplementation.createDocument to create the new Document node and root element, use the importNode operation to clone the existing DocumentFragment or nodes from the NodeList into a form compatable with this new document, insert the latter into the former. __

Re: Probably a simple question: avoiding xmlns="" on each element...

2003-08-06 Thread Joseph Kesselman
That's entirely correct. The parent element was assigned a default namespace URI

Probably a simple question: avoiding xmlns="" on each element...

2003-08-06 Thread Joseph Kesselman
t element... : was Joseph Kesselman/Watson/IBM received

Re: DocumentFragInpl() exception : HIERARCHY_REQUEST_ERR

2003-08-04 Thread Joseph Kesselman
According to DOM Level 2, you can not actually insert or remove the root element of a Document; it must be created at the same time as the Document node (see the DOMImplementation.createDocument method). This is tied into the fact that in some DOMs, both the DTD/schema and the namespaced name o

Re: xerces always escapes ampersands

2003-08-04 Thread Joseph Kesselman
>when xerces writes this out to a file, I invariably get: >"€" How are you creating the node? If you write the string "€" to any of the common XML APIs, it is presumed that you want that value to appear in the infoset, and to achieve that the ampersand must be escaped when this is seria

Re: Doubts & concerns

2003-07-24 Thread Joseph Kesselman
>Aren't the telecom companies sponsoring the development of Apache software Would that they were. __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed profoundly and unpredictably the day Tim Berners Lee got bitten b

Re: Doubts & concerns

2003-07-24 Thread Joseph Kesselman
Reminder: Xerces, like the rest of Apache, is open source software. If you have complaints about code quality, you are more than welcome to get involved in helping to improve it. Or you can go with a purchased copy rather than a free copy; generally, the largest advantage of doing so is that yo

Why that doesn't work with last version...?

2003-07-23 Thread Joseph Kesselman
ument : was Joseph Kesselman/Watson/IBM received

Re: How can I process this part?

2003-07-14 Thread Joseph Kesselman
>But the part ... is not XML format. >I want to generate java class from it, Xerces can't help you with that. __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed profoundly and unpredictably the day Tim Ber

Re: Processing Instructions and DOM

2003-07-14 Thread Joseph Kesselman
ProcesssingInstruction nodes. See http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1004215813 __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed profoundly and unpredictably the day Tim Berners

Re: changing the Tag of an Element

2003-07-10 Thread Joseph Kesselman
>Not in DOM Level 2. Edit the tree to remove the old element, insert a new >one, and copy the children and attributes from old to new. (Actually, _move_ the children and attrs to the new element rather than having to copy them. Sorry; wrote the above in a hurry.) BTW, this is also covered in

Re: changing the Tag of an Element

2003-07-10 Thread Joseph Kesselman
Not in DOM Level 2. Edit the tree to remove the old element, insert a new one, and copy the children and attributes from old to new. DOM Level 3 has proposed adding a function to do this which *MAY* work in *SOME* implementations. (Architected but optional feature; there are many good reasons

Re: escaping does not work properly

2003-07-09 Thread Joseph Kesselman
Hmmm. Yes, I'd forgotten that clause. You're right, if it says "must" it isn't optional. Tim Bray's comment in the Annotated XML spec (http://www .xml.com/axml/axml.html) is "If you need to put a greater-than sign in an XML document, that's OK, unless the previous two characters happened to be

Re: escaping does not work properly

2003-07-09 Thread Joseph Kesselman
On Wednesday, 07/09/2003 at 12:46 AST, Maksym Kovalenko <[EMAIL PROTECTED]> wrote: > Why in this xml example start tag of 'error' element doesn't end with '>'? > > > This is the error text with the !! There is a '>' -- right before the !!. The real question is why "This is the

RE: escaping does not work properly

2003-07-09 Thread Joseph Kesselman
In fact, the XML grammar is such that a parser *can't* get confused about how to interpret the '>' character. > is provided only for stylistic reasons, because folks thought "" would express the intent more clearly to a human reader than "" would. Unless you plan to hand-edit your XML

Re: assigning ID to nodes

2003-06-30 Thread Joseph Kesselman
To bind non-XML data to arbitrary nodes, see the prototype "user data" hooks. "Height" isn't an XML concept; that depends on how the XML markup is being interpreted. Either way, it sounds like you want to run a tree-walk, visit every node, compute your additional data and attach it... __

Re: Problem with default namespace declaration and XSLT

2003-06-30 Thread Joseph Kesselman
You probably intended this for the Xalan (XSLT processor) user list rather than the Xerces (XML parser) list. Short answer: This is an XSLT FAQ. To match a namespaced element -- whether the source document uses the default namespace or not -- you must use a properly-declared namespace prefix i

Re: How do i find the xerces version number from a xercesImpl.jar file ?

2003-06-27 Thread Joseph Kesselman
Easiest way to find out what version is actually on your classpath is to invoke one of the methods on org.apache.xerces.impl.Version __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed profoundly and unpredictably th

Re: entity subsititution

2003-06-27 Thread Joseph Kesselman
>i knew that this is not a valid xml document. but still i wanted the xerces to parse this data >and accept & as it is. Xerces is an XML parser. If your document isn't well-formed XML, you shouldn't expect Xerces -- or any other XML tool -- to process it. You could try putting your document t

Re: Stylesheet problem......

2003-06-26 Thread Joseph Kesselman
That's a question for the Xalan list, not the Xerces list. First question to answer, after moving over there: Did you use xsl:output to set the output mode to HTML? __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world change

Re: registering schema locations

2003-06-19 Thread Joseph Kesselman
The W3C's Semantic Web folks are investigating what metadata, if any, is implied by a namespace and how it should be retrieved and used. Until they report out, the official answer is that a namespace URI is only a magic string in URI syntax. It does not imply a specific schema, and indeed may

Re: Setting Owner Document

2003-06-10 Thread Joseph Kesselman
I don't know whether Xerces has prototyped this, but DOM Level 3 introduces the adoptNode() method. Support for it will be optional even after DOM3 is a recommendation, but if it can be done at all that's the semi-portable way to do it. If not, see the DOM FAQ re importNode() and other ownerDo

Re: get a complete path from Xalan

2003-06-04 Thread Joseph Kesselman
You might get more answers if you posted this to the Xalan mailing list rather than the Xerces mailing list. There's a path-generator template, and examples of using it, in Part 2 of my recent DeveloperWorks article on styling stylesheets for debugging (http://www.ibm.com/developerworks/xml/li

WBXML and DOM API

2003-05-28 Thread Joseph Kesselman
: was Joseph Kesselman/Watson/IBM received by

Re: don't want the parser to retrieve comments or text nodes in the XML file

2003-05-22 Thread Joseph Kesselman
>What I'm trying to do is: when the parsing is finished, I scan the tree >and do node.removeChild(child) when child is a Text or Comment node. [...] > Is there a way to do that properly during the parsing? a feature to set? The proposed DOM Level 3 load/save API included a filtering mechanism,

Re: Have Node, need to set Attribute

2003-05-20 Thread Joseph Kesselman
>I can see that Elements have a setAttribute method. I have a node (Node n) >and would like to set an attribute. Can I just cast the Node into Element, >or is there a nicer way? 1) As others have said, don't touch setAttribute unless you really want to create a Level 1 Only (non-namespace-tole

Running Xerces1 and 2

2003-05-14 Thread Joseph Kesselman
: was Joseph Kesselman/Watson/IBM received by

Re: StAX?

2003-05-12 Thread Joseph Kesselman
"Pull" APIs sometimes make the consumer's life considerably easier at the cost of sometimes making the producer's life considerably more difficult. It's easier to report good performance numbers in your component when you're in control of the processing loop. As a result, every step in the process

Re: DOM Parsing and Whitespace

2003-05-08 Thread Joseph Kesselman
On Thursday, 05/08/2003 at 02:33 MST, Christian Nelson <[EMAIL PROTECTED]> wrote: > Someone else mention that the include-ignorable-whitespace feature only > works for DTDs, not schemas. > Now the question is, what's the equivilent feature or option for when one > is using a schema in place of a D

Re: DOM Parsing and Whitespace

2003-05-08 Thread Joseph Kesselman
Does your document point to a DTD, so the parser can tell what is whitespace-in-element-content and what isn't? Note that the schema working group decided that schemas do _not_ set this flag in the Infoset. __ Joe Kesselman, IBM Next-Generation Web Technologie

RE: XMLSerializer attributes and carriage returns - bug?

2003-05-06 Thread Joseph Kesselman
>The resulting XSLT is then misinterpreted by Xalan (matching a space rather >than a CR or LF) You still haven't shown us the relevant portion of the document. If these characters appear in an Attribute value, that's correct parser operation per XML's rules. See http://www.w3.org/TR/REC-xml#AVNo

Re: XMLSerializer attributes and carriage returns - bug?

2003-05-06 Thread Joseph Kesselman
> When I serialize this document with XMLSerializer these > carriage returns and line feeds appear in the output as exactly that - but > this then causes problems using the document as an XSLT It's hard to offer specific advice without seeing a specific example, but: 1) Remember that XML normali

RE: SAXParserException

2003-05-05 Thread Joseph Kesselman
Unicode is the character set. Unicode 0x0 is the character whose numeric code is 0x0 -- yes, that's NUL. If this is only happening intermittantly, I'd suspect there's a timing problem somewhere in the data path. The question is where. Best suggestion I can offer is that you install a filter in th

Re: SAXParserException

2003-05-05 Thread Joseph Kesselman
The exception means that your document contains a non-XML character, and hence can't be processed correctly by an XML parser. This suggests that whatever is generating the document or delivering it to you is broken... __ Joe Kesselman, IBM Next-Generation Web T

Re: xerces not parsing elements correctly

2003-05-02 Thread Joseph Kesselman
This sounds like the standard SAX mistake of forgetting that text may be delivered as multiple calls to characters() rather than just one, due to parser buffering issues. It's the SAX application's responsibility to deal with that in some appropriate way, most often by reassembling the data in

RE: namespace

2003-04-23 Thread Joseph Kesselman
On Wednesday, 04/23/2003 at 10:27ZE12, Simon Kitching <[EMAIL PROTECTED]> wrote: > "NS" suffix is just to distinguish this method from the "old" DOM v1 > method "createAttribute" which creates an attribute that is in no > namespace (or is it the default namespace; I can never remember..). Actuall

Re: Deferred nodes

2003-04-18 Thread Joseph Kesselman
>is there a way to un-instantiate these child nodes?   Only by editing the document tree -- remove them from their parent and let GC recover the memory they were using. If memory use is an issue, you may want to consider a SAX-based solution, building an in-memory model only for the portions of

Re: Using Namespaces with Xerces-J-2.4.0

2003-04-18 Thread Joseph Kesselman
DTDs predate namespaces, and don't consider them to be different from any other attribute. To use namespace declarations in a DTD-validated document, the DTD must be written to allow those attributes at the relevant points. Yes, this is a major nuisance, and it means you must use the specific pref

  1   2   3   >