protected String getErrorCodeForDecomposingFunctionItems() { boolean isXSLT = getPipelineConfiguration().getHostLanguage() == Configuration.XSLT; return isXSLT ? "XTDE0450" : "XQTY0105"; // Use SENR0001 when doing sequence normalization as per the Serialization spec. }
protected String getErrorCodeForDecomposingFunctionItems() { boolean isXSLT = getPipelineConfiguration().getHostLanguage() == Configuration.XSLT; return isXSLT ? "XTDE0450" : "XQTY0105"; // Use SENR0001 when doing sequence normalization as per the Serialization spec. }
/** * Create a ComplexContentOutputter * @param next the next receiver in the pipeline */ public ComplexContentOutputter(Receiver next) { super(next.getPipelineConfiguration()); setReceiver(next); setHostLanguage(next.getPipelineConfiguration().getHostLanguage()); }
/** * Create a ComplexContentOutputter * @param next the next receiver in the pipeline */ public ComplexContentOutputter(Receiver next) { super(next.getPipelineConfiguration()); setReceiver(next); setHostLanguage(next.getPipelineConfiguration().getHostLanguage()); }
/** * Notify an attribute. Attributes are notified after the startElement event, and before any * children. Namespaces and attributes may be intermingled. * * @param nameCode The name of the attribute * @param typeCode The type of the attribute * @param locationId the location of the node in the source, or of the instruction that created it * @param properties Bit significant value. The following bits are defined: * <dl> * <dd>DISABLE_ESCAPING</dd> <dt>Disable escaping for this attribute</dt> * <dd>NO_SPECIAL_CHARACTERS</dd> <dt>Attribute value contains no special characters</dt> * </dl> * @throws IllegalStateException: attempt to output an attribute when there is no open element * start tag */ public void attribute(NodeName nameCode, SimpleType typeCode, CharSequence value, Location locationId, int properties) throws XPathException { boolean documentLevel = level == 0 || isDocumentLevel[level - 1]; if (documentLevel || !inStartTag) { throw NoOpenStartTagException.makeNoOpenStartTagException( Type.ATTRIBUTE, nameCode.getDisplayName(), getPipelineConfiguration().getHostLanguage(), documentLevel, ExplicitLocation.UNKNOWN_LOCATION); } nextReceiver.attribute(nameCode, typeCode, value, locationId, properties); previousAtomic = false; }
public void namespace(int namespaceCode, int properties) throws XPathException { if (!acceptAttributes) { throw NoOpenStartTagException.makeNoOpenStartTagException( Type.NAMESPACE, getNamePool().getPrefixFromNamespaceCode(namespaceCode), getPipelineConfiguration().getHostLanguage(), inDocument, false); } // avoid duplicates for (int n=0; n<countStack[depth - 1]; n++) { if (namespaces[namespacesSize - 1 - n] == namespaceCode) { return; } } addToStack(namespaceCode); countStack[depth - 1]++; }
/** * Notify a namespace. Namespaces are notified <b>after</b> the startElement event, and before * any children for the element. The namespaces that are reported are only required * to include those that are different from the parent element; however, duplicates may be reported. * A namespace must not conflict with any namespaces already used for element or attribute names. * * @param namespaceBindings the prefix/uri pair * @throws IllegalStateException: attempt to output a namespace when there is no open element * start tag */ public void namespace(NamespaceBindingSet namespaceBindings, int properties) throws XPathException { boolean documentLevel = level == 0 || isDocumentLevel[level - 1]; if (documentLevel || !inStartTag) { //noinspection LoopStatementThatDoesntLoop for (NamespaceBinding ns : namespaceBindings) { // Throw an exception if there is an least one namespace binding in the set throw NoOpenStartTagException.makeNoOpenStartTagException( Type.NAMESPACE, ns.getPrefix(), getPipelineConfiguration().getHostLanguage(), documentLevel, ExplicitLocation.UNKNOWN_LOCATION); } } nextReceiver.namespace(namespaceBindings, properties); previousAtomic = false; }
public void namespace(int namespaceCode, int properties) throws XPathException { if (!acceptAttributes) { throw NoOpenStartTagException.makeNoOpenStartTagException( Type.NAMESPACE, getNamePool().getPrefixFromNamespaceCode(namespaceCode), getPipelineConfiguration().getHostLanguage(), inDocument, false); } // avoid duplicates for (int n=0; n<countStack[depth - 1]; n++) { if (namespaces[namespacesSize - 1 - n] == namespaceCode) { return; } } addToStack(namespaceCode); countStack[depth - 1]++; }
/** * Notify a namespace. Namespaces are notified <b>after</b> the startElement event, and before * any children for the element. The namespaces that are reported are only required * to include those that are different from the parent element; however, duplicates may be reported. * A namespace must not conflict with any namespaces already used for element or attribute names. * * @param namespaceBindings the prefix/uri pair * @throws IllegalStateException: attempt to output a namespace when there is no open element * start tag */ public void namespace(NamespaceBindingSet namespaceBindings, int properties) throws XPathException { boolean documentLevel = level == 0 || isDocumentLevel[level - 1]; if (documentLevel || !inStartTag) { //noinspection LoopStatementThatDoesntLoop for (NamespaceBinding ns : namespaceBindings) { // Throw an exception if there is an least one namespace binding in the set throw NoOpenStartTagException.makeNoOpenStartTagException( Type.NAMESPACE, ns.getPrefix(), getPipelineConfiguration().getHostLanguage(), documentLevel, ExplicitLocation.UNKNOWN_LOCATION); } } nextReceiver.namespace(namespaceBindings, properties); previousAtomic = false; }
public void namespace(NamespaceBindingSet namespaceBindings, int properties) throws XPathException { for (NamespaceBinding ns : namespaceBindings) { if (!acceptAttributes) { throw NoOpenStartTagException.makeNoOpenStartTagException( Type.NAMESPACE, ns.getPrefix(), getPipelineConfiguration().getHostLanguage(), inDocument, ExplicitLocation.UNKNOWN_LOCATION); } // avoid duplicates for (int n = 0; n < countStack[depth - 1]; n++) { if (namespaces[namespacesSize - 1 - n].equals(namespaceBindings)) { return; } } addToStack(ns); countStack[depth - 1]++; } }
public void namespace(NamespaceBindingSet namespaceBindings, int properties) throws XPathException { for (NamespaceBinding ns : namespaceBindings) { if (!acceptAttributes) { throw NoOpenStartTagException.makeNoOpenStartTagException( Type.NAMESPACE, ns.getPrefix(), getPipelineConfiguration().getHostLanguage(), inDocument, ExplicitLocation.UNKNOWN_LOCATION); } // avoid duplicates for (int n = 0; n < countStack[depth - 1]; n++) { if (namespaces[namespacesSize - 1 - n].equals(namespaceBindings)) { return; } } addToStack(ns); countStack[depth - 1]++; } }
throw NoOpenStartTagException.makeNoOpenStartTagException( Type.ATTRIBUTE, attName.getDisplayName(), getPipelineConfiguration().getHostLanguage(), inDocument, ExplicitLocation.UNKNOWN_LOCATION);
/** * Notify a namespace. Namespaces are notified <b>after</b> the startElement event, and before * any children for the element. The namespaces that are reported are only required * to include those that are different from the parent element; however, duplicates may be reported. * A namespace must not conflict with any namespaces already used for element or attribute names. * @param namespaceCode an integer: the top half is a prefix code, the bottom half a URI code. * These may be translated into an actual prefix and URI using the name pool. A prefix code of * zero represents the empty prefix (that is, the default namespace). A URI code of zero represents * a URI of "", that is, a namespace undeclaration. * @throws IllegalStateException: attempt to output a namespace when there is no open element * start tag */ public void namespace(int namespaceCode, int properties) throws XPathException { if (contentStarted) { throw NoOpenStartTagException.makeNoOpenStartTagException( Type.NAMESPACE, getNamePool().getPrefixFromNamespaceCode(namespaceCode), getPipelineConfiguration().getHostLanguage(), true, getPipelineConfiguration().isSerializing()); } nextReceiver.namespace(namespaceCode, properties); previousAtomic = false; }
/** * Notify an attribute. Attributes are notified after the startElement event, and before any * children. Namespaces and attributes may be intermingled. * @param nameCode The name of the attribute, as held in the name pool * @param typeCode The type of the attribute, as held in the name pool * @param properties Bit significant value. The following bits are defined: * <dd>DISABLE_ESCAPING</dd> <dt>Disable escaping for this attribute</dt> * <dd>NO_SPECIAL_CHARACTERS</dd> <dt>Attribute value contains no special characters</dt> * @throws IllegalStateException: attempt to output an attribute when there is no open element * start tag */ public void attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties) throws XPathException { boolean documentLevel = level==0 || isDocumentLevel[level-1]; if (documentLevel || !inStartTag) { throw NoOpenStartTagException.makeNoOpenStartTagException( Type.ATTRIBUTE, getNamePool().getDisplayName(nameCode), getPipelineConfiguration().getHostLanguage(), documentLevel, getPipelineConfiguration().isSerializing()); } nextReceiver.attribute(nameCode, typeCode, value, locationId, properties); previousAtomic = false; }
/** * Notify a namespace. Namespaces are notified <b>after</b> the startElement event, and before * any children for the element. The namespaces that are reported are only required * to include those that are different from the parent element; however, duplicates may be reported. * A namespace must not conflict with any namespaces already used for element or attribute names. * @param namespaceCode an integer: the top half is a prefix code, the bottom half a URI code. * These may be translated into an actual prefix and URI using the name pool. A prefix code of * zero represents the empty prefix (that is, the default namespace). A URI code of zero represents * a URI of "", that is, a namespace undeclaration. * @throws IllegalStateException: attempt to output a namespace when there is no open element * start tag */ public void namespace(int namespaceCode, int properties) throws XPathException { boolean documentLevel = level==0 || isDocumentLevel[level-1]; if (documentLevel || !inStartTag) { throw NoOpenStartTagException.makeNoOpenStartTagException( Type.NAMESPACE, getNamePool().getPrefixFromNamespaceCode(namespaceCode), getPipelineConfiguration().getHostLanguage(), documentLevel, getPipelineConfiguration().isSerializing()); } nextReceiver.namespace(namespaceCode, properties); previousAtomic = false; }
/** * Notify an attribute. Attributes are notified after the startElement event, and before any * children. Namespaces and attributes may be intermingled. * @param nameCode The name of the attribute, as held in the name pool * @param typeCode The type of the attribute, as held in the name pool * @param properties Bit significant value. The following bits are defined: * <dd>DISABLE_ESCAPING</dd> <dt>Disable escaping for this attribute</dt> * <dd>NO_SPECIAL_CHARACTERS</dd> <dt>Attribute value contains no special characters</dt> * @throws IllegalStateException: attempt to output an attribute when there is no open element * start tag */ public void attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties) throws XPathException { if (contentStarted) { throw NoOpenStartTagException.makeNoOpenStartTagException( Type.ATTRIBUTE, getNamePool().getDisplayName(nameCode), getPipelineConfiguration().getHostLanguage(), true, getPipelineConfiguration().isSerializing()); } nextReceiver.attribute(nameCode, typeCode, value, locationId, properties); previousAtomic = false; }
checkNotNamespaceSensitiveElement(type, nodeNr); } catch (CopyNamespaceSensitiveException e) { int lang = receiver.getPipelineConfiguration().getHostLanguage(); e.setErrorCode(lang == Configuration.XSLT ? "XTTE0950" : "XQTY0086"); throw e;
checkNotNamespaceSensitiveElement(type, nodeNr); } catch (CopyNamespaceSensitiveException e) { int lang = receiver.getPipelineConfiguration().getHostLanguage(); e.setErrorCode(lang == Configuration.XSLT ? "XTTE0950" : "XQTY0086"); throw e;
/** * Create a TinyTree to hold a document or element node. * @throws net.sf.saxon.trans.XPathException */ private void createTree() throws XPathException { builder = new TinyBuilder(); builder.setPipelineConfiguration(getPipelineConfiguration()); builder.setSystemId(getSystemId()); NamespaceReducer reducer = new NamespaceReducer(); reducer.setUnderlyingReceiver(builder); reducer.setPipelineConfiguration(getPipelineConfiguration()); ComplexContentOutputter cco = new ComplexContentOutputter(); cco.setHostLanguage(getPipelineConfiguration().getHostLanguage()); cco.setPipelineConfiguration(getPipelineConfiguration()); cco.setReceiver(reducer); outputter = cco; outputter.setSystemId(systemId); outputter.setPipelineConfiguration(getPipelineConfiguration()); outputter.open(); }
/** * Create a TinyTree to hold a document or element node. * @throws net.sf.saxon.trans.XPathException */ private void createTree() throws XPathException { PipelineConfiguration pipe = getPipelineConfiguration(); builder = pipe.getController().makeBuilder(); builder.setPipelineConfiguration(pipe); builder.setSystemId(getSystemId()); builder.setTiming(false); NamespaceReducer reducer = new NamespaceReducer(); reducer.setUnderlyingReceiver(builder); reducer.setPipelineConfiguration(getPipelineConfiguration()); ComplexContentOutputter cco = new ComplexContentOutputter(); cco.setHostLanguage(getPipelineConfiguration().getHostLanguage()); cco.setPipelineConfiguration(getPipelineConfiguration()); cco.setReceiver(reducer); outputter = cco; outputter.setSystemId(systemId); outputter.setPipelineConfiguration(getPipelineConfiguration()); outputter.open(); }