cvs commit: xml-xerces/java/src/org/apache/xerces/parsers AbstractDOMParser.java
mrglavas2003/11/11 07:59:42 Modified:java/src/org/apache/xerces/parsers AbstractDOMParser.java Log: For DOM Level 3 TypeInfo, if an attribute was not declared in the DTD, its type name is null. Using new augmentations property "ATTRIBUTE_DECLARED" to propogate this information to the DOM Attr. http://www.w3.org/TR/2003/CR-DOM-Level-3-Core-20031107/core.html#TypeInfo-typeName Revision ChangesPath 1.93 +6 -2 xml-xerces/java/src/org/apache/xerces/parsers/AbstractDOMParser.java Index: AbstractDOMParser.java === RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/AbstractDOMParser.java,v retrieving revision 1.92 retrieving revision 1.93 diff -u -r1.92 -r1.93 --- AbstractDOMParser.java7 Nov 2003 00:20:41 - 1.92 +++ AbstractDOMParser.java11 Nov 2003 15:59:42 - 1.93 @@ -968,7 +968,11 @@ else { // DTD type = attributes.getType(i); - attrImpl.setType(type); + boolean isDeclared = Boolean.TRUE.equals(attributes.getAugmentations(i).getItem(Constants.ATTRIBUTE_DECLARED)); + // For DOM Level 3 TypeInfo, the type name must + // be null if this attribute has not been declared + // in the DTD. + attrImpl.setType(isDeclared ? type : null); id = (type.equals("ID")) ? true : false; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-xerces/java/src/org/apache/xerces/parsers AbstractDOMParser.java
mrglavas2003/11/11 08:52:36 Modified:java/src/org/apache/xerces/parsers AbstractDOMParser.java Log: I missed DefferredDOM on the last commit. Also, if the attribute wasn't declared, then there's no reason to lookup its type from XMLAttributes. Revision ChangesPath 1.94 +19 -11 xml-xerces/java/src/org/apache/xerces/parsers/AbstractDOMParser.java Index: AbstractDOMParser.java === RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/AbstractDOMParser.java,v retrieving revision 1.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- AbstractDOMParser.java11 Nov 2003 15:59:42 - 1.93 +++ AbstractDOMParser.java11 Nov 2003 16:52:35 - 1.94 @@ -966,14 +966,16 @@ } } else { - // DTD -type = attributes.getType(i); - boolean isDeclared = Boolean.TRUE.equals(attributes.getAugmentations(i).getItem(Constants.ATTRIBUTE_DECLARED)); - // For DOM Level 3 TypeInfo, the type name must - // be null if this attribute has not been declared - // in the DTD. - attrImpl.setType(isDeclared ? type : null); - id = (type.equals("ID")) ? true : false; +// DTD +boolean isDeclared = Boolean.TRUE.equals(attributes.getAugmentations(i).getItem(Constants.ATTRIBUTE_DECLARED)); +// For DOM Level 3 TypeInfo, the type name must +// be null if this attribute has not been declared +// in the DTD. +if (isDeclared) { +type = attributes.getType(i); +} +attrImpl.setType(type); +id = (type.equals("ID")) ? true : false; } if (id) { @@ -1064,8 +1066,14 @@ } } else { - // DTD - type = attributes.getType(i); +// DTD +boolean isDeclared = Boolean.TRUE.equals(attributes.getAugmentations(i).getItem(Constants.ATTRIBUTE_DECLARED)); +// For DOM Level 3 TypeInfo, the type name must +// be null if this attribute has not been declared +// in the DTD. +if (isDeclared) { +type = attributes.getType(i); +} id = (type.equals("ID")) ? true : false; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs/traversers XSDComplexTypeTraverser.java XSDElementTraverser.java
sandygao2003/11/11 09:35:18 Modified:java/src/org/apache/xerces/impl/xs/traversers XSDComplexTypeTraverser.java XSDElementTraverser.java Log: More PSVI related fixes. We didn't have proper final/block values on element and complex declarations. Revision ChangesPath 1.40 +8 -13 xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java Index: XSDComplexTypeTraverser.java === RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- XSDComplexTypeTraverser.java 10 Nov 2003 20:44:41 - 1.39 +++ XSDComplexTypeTraverser.java 11 Nov 2003 17:35:17 - 1.40 @@ -225,18 +225,13 @@ fName = complexTypeName; fComplexTypeDecl.setName(fName); fTargetNamespace = schemaDoc.fTargetNamespace; -if (blockAtt == null) { -fBlock = (short)(schemaDoc.fBlockDefault&(XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION)); -} -else { -fBlock = blockAtt.shortValue(); -} -if (finalAtt == null) { -fFinal = (short)(schemaDoc.fFinalDefault&(XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION)); -} -else { -fFinal = finalAtt.shortValue(); -} + +fBlock = blockAtt == null ? schemaDoc.fBlockDefault : blockAtt.shortValue(); +fFinal = finalAtt == null ? schemaDoc.fFinalDefault : finalAtt.shortValue(); +//discard valid Block/Final 'Default' values that are invalid for Block/Final +fBlock &= (XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION); +fFinal &= (XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION); + if (abstractAtt != null && abstractAtt.booleanValue()) fIsAbstract = true; 1.27 +7 -13 xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java Index: XSDElementTraverser.java === RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- XSDElementTraverser.java 10 Nov 2003 20:44:41 - 1.26 +++ XSDElementTraverser.java 11 Nov 2003 17:35:17 - 1.27 @@ -310,18 +310,12 @@ } // get 'block', 'final', 'nillable', 'abstract' -if (blockAtt == null) { -element.fBlock = (short)(schemaDoc.fBlockDefault&(XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION | XSConstants.DERIVATION_SUBSTITUTION)); -} -else { -element.fBlock = blockAtt.shortValue(); -} -if (finalAtt == null) { -element.fFinal = (short)(schemaDoc.fFinalDefault&(XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION)); -} -else { -element.fFinal = finalAtt.shortValue(); -} +element.fBlock = blockAtt == null ? schemaDoc.fBlockDefault : blockAtt.shortValue(); +element.fFinal = finalAtt == null ? schemaDoc.fFinalDefault : finalAtt.shortValue(); +// discard valid Block/Final 'Default' values that are invalid for Block/Final +element.fBlock &= (XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION | XSConstants.DERIVATION_SUBSTITUTION); +element.fFinal &= (XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION); + if (nillableAtt.booleanValue()) element.setIsNillable(); if (abstractAtt != null && abstractAtt.booleanValue()) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: rev 129 - xml/xerces-p/branches/2.3.0
Author: jasons Date: Tue Nov 11 09:36:59 2003 New Revision: 129 Added: xml/xerces-p/branches/2.3.0/ - copied from rev 128, xml/xerces-p/trunk/ Log: 2.3.0 branch creation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-xerces/java/src/org/apache/xerces/dom DOMNormalizer.java
venu2003/11/11 10:15:20 Modified:java/src/org/apache/xerces/dom DOMNormalizer.java Log: Thanks to Kohsuke Kawaguchi for the patch . Revision ChangesPath 1.34 +53 -68xml-xerces/java/src/org/apache/xerces/dom/DOMNormalizer.java Index: DOMNormalizer.java === RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/DOMNormalizer.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- DOMNormalizer.java8 May 2003 19:52:40 - 1.33 +++ DOMNormalizer.java11 Nov 2003 18:15:20 - 1.34 @@ -149,7 +149,7 @@ /** symbol table */ protected SymbolTable fSymbolTable; -/** error handler */ +/** error handler. may be null. */ protected DOMErrorHandler fErrorHandler; // Validation against namespace aware grammar @@ -167,8 +167,6 @@ /** list of attributes */ protected final Vector fAttributeList = new Vector(5,10); -/** DOM Error object */ -protected final DOMErrorImpl fDOMError = new DOMErrorImpl(); /** DOM Locator - for namespace fixup algorithm */ protected final DOMLocatorImpl fLocator = new DOMLocatorImpl(); @@ -180,6 +178,12 @@ // attribute value normalization final XMLString fNormalizedValue = new XMLString(new char[16], 0, 0); +/** + * If the user stops the normalization process, this exception will be thrown. + */ +private static final RuntimeException abort = new RuntimeException(); + + // // Constructor // @@ -250,16 +254,9 @@ } } catch (RuntimeException e) { - // fatal error occured - modifyDOMError( - "Runtime exception: " + e.getMessage(), - DOMError.SEVERITY_FATAL_ERROR, - null); - - this.fErrorHandler.handleError(fDOMError); - if (true) { - e.printStackTrace(); - } +if( e==abort ) +return; // processing aborted by the user +throw e;// otherwise re-throw. } } @@ -463,17 +460,19 @@ if ((fConfiguration.features & DOMConfigurationImpl.SPLITCDATA) != 0) { String value = node.getNodeValue(); -int index = value.indexOf("]]>"); -if (index >= 0) { -// REVISIT: issue warning -} +int index; Node parent = node.getParentNode(); -while ( index >= 0 ) { +while ( (index=value.indexOf("]]>")) >= 0 ) { node.setNodeValue(value.substring(0, index+2)); value = value.substring(index +2); -node = fDocument.createCDATASection(value); -parent.insertBefore(node, node.getNextSibling()); -index = value.indexOf("]]>"); +Node newChild = fDocument.createCDATASection(value); +parent.insertBefore(newChild, node.getNextSibling()); +node = newChild; + +// issue warning +reportDOMError( +"CDATA sections containing the CDATA section termination marker ']]>'", +DOMError.SEVERITY_WARNING, node, "cdata-sections-splitted"); } } break; @@ -565,7 +564,7 @@ // // -String localUri, value, name, uri, prefix; +String value, name, uri, prefix; if (attributes != null) { // Record all valid local declarations @@ -581,15 +580,8 @@ // Check for invalid namespace declaration: if (value.equals(NamespaceContext.XMLNS_URI)) { -if (fErrorHandler != null) { -modifyDOMError("No prefix other than 'xmlns' can be bound to 'http://www.w3.org/2000/xmlns/' namespace name", - DOMError.SEVERITY_ERROR, attr); -boolean continueProcess = fErrorHandler.handleError(fDOMError); -if (!continueProcess) { -// stop the namespace fixup and validation -throw new RuntimeException("Stopped at user request"); -} -
cvs commit: xml-xerces/java/src/org/apache/xerces/xs - New directory
sandygao2003/11/11 12:08:59 xml-xerces/java/src/org/apache/xerces/xs - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-xerces/java/tests/dom/dom3 Test.java
sandygao2003/11/11 12:15:02 Modified:java build.xml java/samples/simpletype SimpleTypeUsage.java java/samples/xni PSVIWriter.java java/src/org/apache/xerces/dom DOMNormalizer.java DeferredElementNSImpl.java ElementNSImpl.java PSVIAttrNSImpl.java PSVIElementNSImpl.java java/src/org/apache/xerces/impl/dv SchemaDVFactory.java XSFacets.java XSSimpleType.java java/src/org/apache/xerces/impl/dv/xs BaseDVFactory.java SchemaDVFactoryImpl.java XSSimpleTypeDecl.java java/src/org/apache/xerces/impl/xs AttributePSVImpl.java ElementPSVImpl.java SchemaGrammar.java SubstitutionGroupHandler.java XMLSchemaValidator.java XSAnnotationImpl.java XSAttributeDecl.java XSAttributeGroupDecl.java XSAttributeUseImpl.java XSComplexTypeDecl.java XSConstraints.java XSElementDecl.java XSGroupDecl.java XSModelGroupImpl.java XSModelImpl.java XSNotationDecl.java XSParticleDecl.java XSWildcardDecl.java java/src/org/apache/xerces/impl/xs/identity Field.java IdentityConstraint.java KeyRef.java Selector.java XPathMatcher.java java/src/org/apache/xerces/impl/xs/traversers XSAttributeChecker.java XSDAbstractTraverser.java XSDAttributeTraverser.java XSDComplexTypeTraverser.java XSDElementTraverser.java XSDSimpleTypeTraverser.java java/src/org/apache/xerces/impl/xs/util NSItemListImpl.java StringListImpl.java XSGrammarPool.java XSNamedMap4Types.java XSNamedMapImpl.java XSObjectListImpl.java java/src/org/apache/xerces/parsers AbstractDOMParser.java AbstractSAXParser.java java/src/org/apache/xerces/xni/grammars XSGrammar.java java/tests/dom/dom3 Test.java Added: java/src/org/apache/xerces/xs AttributePSVI.java ElementPSVI.java ItemPSVI.java PSVIProvider.java StringList.java XSAnnotation.java XSAttributeDeclaration.java XSAttributeGroupDefinition.java XSAttributeUse.java XSComplexTypeDefinition.java XSConstants.java XSElementDeclaration.java XSFacet.java XSIDCDefinition.java XSModel.java XSModelGroup.java XSModelGroupDefinition.java XSMultiValueFacet.java XSNamedMap.java XSNamespaceItem.java XSNamespaceItemList.java XSNotationDeclaration.java XSObject.java XSObjectList.java XSParticle.java XSSimpleTypeDefinition.java XSTerm.java XSTypeDefinition.java XSWildcard.java Removed: java/src/org/apache/xerces/impl/xs/psvi PSVIProvider.java StringList.java XSAnnotation.java XSAttributeDeclaration.java XSAttributeGroupDefinition.java XSAttributeUse.java XSComplexTypeDefinition.java XSConstants.java XSElementDeclaration.java XSFacet.java XSIDCDefinition.java XSModel.java XSModelGroup.java XSModelGroupDefinition.java XSMultiValueFacet.java XSNamedMap.java XSNamespaceItem.java XSNamespaceItemList.java XSNotationDeclaration.java XSObject.java XSObjectList.java XSParticle.java XSSimpleTypeDefinition.java XSTerm.java XSTypeDefinition.java XSWildcard.java java/src/org/apache/xerces/xni/psvi AttributePSVI.java ElementPSVI.java ItemPSVI.java Log: PSVI API changes. Step 1: Move classes from packages org.apache.xerces.impl.xs.psvi and org.apache.xercex.xni.psvi to org.apache.xerces.xs. Revision ChangesPath 1.145 +27 -27xml-xerces/java/build.xml http://cvs.apache.org/viewcvs/xml-xerces/java/build.xml.diff?r1=1.144&r2=1.145 1.5 +3 -3 xml-xerces/java/samples/simpletype/SimpleTypeUsage.java http://cvs.apache.org/viewcvs/xml-xerces/java/samples/simpletype/SimpleTypeUsage.java.diff?r1=1.4&r2=1.5 1.24 +28 -28xml-xerces/java/samples/xni/PSVIWriter.java http://cvs.apache.org/viewcvs/xml-xerces/java/samples/xni/PSVIWriter.java.diff?r1=1.23&r2=1.24 1.35 +4 -4 xml-xerces/java/src/org/apach
cvs commit: xml-xerces/c/src/xercesc/validators/schema SchemaGrammar.cpp
knoaman 2003/11/11 14:48:13 Modified:c/src/xercesc/framework/psvi XSAnnotation.cpp XSAnnotation.hpp c/src/xercesc/internal XSerializeEngine.hpp XTemplateSerializer.cpp XTemplateSerializer.hpp c/src/xercesc/validators/schema SchemaGrammar.cpp Log: Serialization of XSAnnotation. Revision ChangesPath 1.3 +38 -0 xml-xerces/c/src/xercesc/framework/psvi/XSAnnotation.cpp Index: XSAnnotation.cpp === RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/psvi/XSAnnotation.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- XSAnnotation.cpp 6 Nov 2003 19:28:11 - 1.2 +++ XSAnnotation.cpp 11 Nov 2003 22:48:13 - 1.3 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.3 2003/11/11 22:48:13 knoaman + * Serialization of XSAnnotation. + * * Revision 1.2 2003/11/06 19:28:11 knoaman * PSVI support for annotations. * @@ -77,6 +80,13 @@ { } +XSAnnotation::XSAnnotation(MemoryManager * const manager): +XSObject(XSConstants::ANNOTATION, manager) +, fContents(0) +, fNext(0) +{ +} + XSAnnotation::~XSAnnotation() { fMemoryManager->deallocate(fContents); @@ -117,7 +127,35 @@ fNext = nextAnnotation; } +/*** + * Support for Serialization/De-serialization + ***/ + +IMPL_XSERIALIZABLE_TOCREATE(XSAnnotation) +void XSAnnotation::serialize(XSerializeEngine& serEng) +{ +/*** + * Since we are pretty sure that fIdMap and fHashTable is + * not shared by any other object, therefore there is no owned/referenced + * issue. Thus we can serialize the raw data only, rather than serializing + * both fIdMap and fHashTable. + * + * And we can rebuild the fIdMap and fHashTable out of the raw data during + * deserialization. + * +***/ +if (serEng.isStoring()) +{ +serEng.writeString(fContents); +serEng<>fNext; +} +} XERCES_CPP_NAMESPACE_END 1.3 +12 -1 xml-xerces/c/src/xercesc/framework/psvi/XSAnnotation.hpp Index: XSAnnotation.hpp === RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/psvi/XSAnnotation.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- XSAnnotation.hpp 6 Nov 2003 19:28:11 - 1.2 +++ XSAnnotation.hpp 11 Nov 2003 22:48:13 - 1.3 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.3 2003/11/11 22:48:13 knoaman + * Serialization of XSAnnotation. + * * Revision 1.2 2003/11/06 19:28:11 knoaman * PSVI support for annotations. * @@ -68,6 +71,7 @@ #define XSANNOTATION_HPP #include +#include XERCES_CPP_NAMESPACE_BEGIN @@ -79,7 +83,7 @@ */ -class XMLPARSER_EXPORT XSAnnotation : public XSObject +class XMLPARSER_EXPORT XSAnnotation : public XSerializable, public XSObject { public: @@ -159,6 +163,13 @@ void setNext(XSAnnotation* const nextAnnotation); //@} + +/*** + * Support for Serialization/De-serialization + ***/ +DECL_XSERIALIZABLE(XSAnnotation) +XSAnnotation(MemoryManager* const manager); + private: // --- 1.8 +9 -1 xml-xerces/c/src/xercesc/internal/XSerializeEngine.hpp Index: XSerializeEngine.hpp === RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/XSerializeEngine.hpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- XSerializeEngine.hpp 17 Oct 2003 21:09:03 - 1.7 +++ XSerializeEngine.hpp 11 Nov 2003 22:48:13 - 1.8 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.8 2003/11/11 22:48:13 knoaman + * Serialization of XSAnnotation. + * * Revision 1.7 2003/10/17 21:09:03 peiyongz * renaming methods * @@ -533,6 +536,11 @@ inline voidAssert(bool toEval , const XMLExcepts::Codes toThrow) const; + +// Make XTemplateSerializer friend of XSerializeEngine so that +// we can call lookupStorePool and lookupLoadPool in the case of +// annotations. +friend class XTemplateSerializer; // --- // data 1.5 +82 -1 xml-xerces/c/src/xercesc/internal/XTemplateSerializer.cpp Index: XTemplateSerializer.cpp === RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/XTemplateSerializer