Hello All,
I have written a class that searches Docx files, how do I publish it or demo it the community to find out if I can add it to the Docx4j github repo?
Regards
Derek.
You chose to search this file: C:\Users\jharrop\git\DocxSearchAndTag\src\main\resources\Example.docx
With this sequence file: C:\Users\jharrop\git\DocxSearchAndTag\SequenceMatch.xml
DocumentEventHandler :
Event: Severity: 2, Message: cvc-complex-type.3.2.2: Attribute 'p:type' is not allowed to appear in element 'p:sequence'., Linked Exception: org.xml.sax.SAXParseException; systemId: file:/C:/Users/jharrop/git/DocxSearchAndTag/SequenceMatch.xml; lineNumber: 7; columnNumber: 65; cvc-complex-type.3.2.2: Attribute 'p:type' is not allowed to appear in element 'p:sequence'., LOCATOR Line Number: 7, Column Number: 65, Offset: -1, Object: null, Node: null, Url: file:/C:/Users/jharrop/git/DocxSearchAndTag/SequenceMatch.xml
java.lang.Exception: javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException; systemId: file:/C:/Users/jharrop/git/DocxSearchAndTag/SequenceMatch.xml; lineNumber: 7; columnNumber: 65; cvc-complex-type.3.2.2: Attribute 'p:type' is not allowed to appear in element 'p:sequence'.]
at ie.decoder.docx.searchandtag.Unmarshall.UnmarshallTheDocument(Unmarshall.java:85)
at ie.decoder.docx.searchandtag.BlobFinder.BlobSetup(BlobFinder.java:94)
at ie.decoder.docx.searchandtag.BlobFinder.Search(BlobFinder.java:153)
at ie.decoder.docx.searchandtag.Main.main(Main.java:64)
Caused by: javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException; systemId: file:/C:/Users/jharrop/git/DocxSearchAndTag/SequenceMatch.xml; lineNumber: 7; columnNumber: 65; cvc-complex-type.3.2.2: Attribute 'p:type' is not allowed to appear in element 'p:sequence'.]
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unknown Source)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
at ie.decoder.docx.searchandtag.Unmarshall.UnmarshallTheDocument(Unmarshall.java:80)
... 3 more
Caused by: org.xml.sax.SAXParseException; systemId: file:/C:/Users/jharrop/git/DocxSearchAndTag/SequenceMatch.xml; lineNumber: 7; columnNumber: 65; cvc-complex-type.3.2.2: Attribute 'p:type' is not allowed to appear in element 'p:sequence'.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.startElement(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.startElement(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
... 10 more
Exception in thread "main" java.lang.NullPointerException
at ie.decoder.docx.searchandtag.BlobFinder.SequenceSearcher(BlobFinder.java:235)
at ie.decoder.docx.searchandtag.BlobFinder.Search(BlobFinder.java:169)
at ie.decoder.docx.searchandtag.Main.main(Main.java:64)
Perhaps you could explain the main ways you see people using it (ie key use cases)?
From a quick look at the code, you're conducting the search on the main document part marshalled to an XML string.
But somewhere I guess you're discarding the OpenXML tags?
So the user can search for just document text, or OpenXML tags (eg w:p), or some hybrid (eg "p>A continent") - not sure at what point the tags are getting discarded.
When the search is complete, we have text (not OpenXML), plus your tags?
Users browsing this forum: No registered users and 57 guests