I am using Docbook 1.78 and xsltproc (libxslt 1.1.26 with libxml 2.7.8) in command line to generate a fo-file from an XML file. My aim is to generate a PDF using Apache formatted output processor (fop; version 1.1).
My XML-Input file:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE book SYSTEM "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<book lang="de" id="MyBook">
<chapter id="Introduction">
<title>Introduction</title>
<section id="sec_intro_1">
<title>Test</title>
<para>para1_sec_intro_1 (see also glossary: <xref linkend="gloss_etm-datei"/>).</para>
<para>para2_sec_intro_1</para>
</section>
<section id="sec_intro_2">
<title>Another Test</title>
<para>para1_sec_intro_2 (glossary: <xref linkend="gloss_etm-datei"/>).</para>
<para>para2_sec_intro2</para>
</section>
</chapter>
<xi:include href="glossar_test.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
</book>
If I run the following command
xsltproc -o ./test.fo --xinclude --stringparam paper.type A4 --stringparam fop1.extensions 1 ./docbook/fo/docbook.xsl ./test.xml 2> fo_out.txt
The fo-file is generated but it contains fo:wrapper elements with IDs which are not unique. This is the generated fo-file:
...
(see also glossary: <fo:basic-link internal-destination="gloss_etm-datei"><fo:inline>
<fo:wrapper id="idp8751564240"><!--ETM-Datei--></fo:wrapper>
<fo:inline font-weight="bold">ETM-Datei</fo:inline>
</fo:inline></fo:basic-link>)
....
(glossary: <fo:basic-link internal-destination="gloss_etm-datei"><fo:inline>
<fo:wrapper id="idp8751564240"><!--ETM-Datei--></fo:wrapper>
<fo:inline font-weight="bold">ETM-Datei</fo:inline>
</fo:inline></fo:basic-link>).
...
Now, if I try to generate a pdf file from that fo-file, fop throws an Exception:
SEVERE: Exception
org.apache.fop.apps.FOPException: org.apache.fop.fo.ValidationException: Property ID "idp8751564240" (found on "fo:wrapper") previously used; ID values must be unique within a document! (See position 6:48)
javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: Property ID "idp8751564240" (found on "fo:wrapper") previously used; ID values must be unique within a document! (See position 6:48)
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:303)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:130)
at org.apache.fop.cli.Main.startFOP(Main.java:177)
at org.apache.fop.cli.Main.main(Main.java:208)
Caused by: javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: Property ID "idp8751564240" (found on "fo:wrapper") previously used; ID values must be unique within a document! (See position 6:48)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:501)
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:300)
... 3 more
Caused by: org.apache.fop.fo.ValidationException: Property ID "idp8751564240" (found on "fo:wrapper") previously used; ID values must be unique within a document! (See position 6:48)
at org.apache.fop.events.ValidationExceptionFactory.createException(ValidationExceptionFactory.java:38)
at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:58)
at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:175)
at com.sun.proxy.$Proxy2.idNotUnique(Unknown Source)
at org.apache.fop.fo.FObj.checkId(FObj.java:173)
at org.apache.fop.fo.FObj.startOfNode(FObj.java:154)
at org.apache.fop.fo.flow.Wrapper.startOfNode(Wrapper.java:65)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:325)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:175)
at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
... 4 more
Am I doing anything wrong here?
I appreciate any help!
Thanks in advance!
EDIT
Here is the glosar_test.xml:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE glossary PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<glossary id="glossar">
<title>Glossar</title>
<glossdiv id="gloss_E">
<title>E</title>
<glossentry id="gloss_etm-datei">
<glossterm id="glossterm_etm_datei">
<indexterm>
<primary>ETM-Datei</primary>
</indexterm>
<emphasis role="bold">ETM-Datei</emphasis>
</glossterm>
<glossdef>
<para>
Glossary_Text
</para>
</glossdef>
</glossentry>
</glossdiv>
</glossary>
I've found a solution!
At http://www.sagehill.net/docbookxsl/LinkToGlossary.html it is described how to reference to a gloassary. Normally, you would use the glossterm-tag, e.g.:
<para>Set your <glossterm linkend="NetAddr">network address</glossterm>.
</para>
...
<glossary>
<glossentry id="NetAddr">
<glossterm>Network address</glossterm>
<glossdef><para>Four numbers separated by periods</para></glossdef>
</glossentry>
</glossary>
You also can use the link or xref-tag. If you use the xref-tag you must add an id attribute to the glossterm and add a matching endterm attribute to the xref element. For example:
<xref linkend="ge-xslfoprocessor" endterm="gt-xslfoprocessor"/>
...
<glossentry id="ge-xslfoprocessor">
<glossterm id="gt-xslfoprocessor">XSL-FO processor</glossterm>
<glossdef>
<para>Software component that converts an XSL-FO document into a
formatted document.</para>
</glossdef>
</glossentry>
If you do so, the ids of the fo:wrapper will be removed and fop can parse it to a pdf file.
Related
I am trying to add a template to an existing docbook system, and I don't understand how the whole thing works. I figured out how to add verbose logging so my simple addition now generates about 250000 lines of log output. I know the syntax is correct, but the template is not added to the rest of the system.
Here is the included code:
?xml version="1.0" encoding="UTF-8"?>
<!-- **********************************************************************
********************************************************************** -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:db="http://docbook.org/ns/docbook"
version='1.0'>
<xsl:template name="mike2">
Add this text
</xsl:template>
<xsl:template match="mike">
<xsl:call-template name="mike2">
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
Here is what I see in the log:
[xsltproc] xsltCompilePattern : parsing 'mike'
[xsltproc] xsltCompilePattern : parsed mike, default priority 0.000000
[xsltproc] added pattern : 'mike' priority 0.000000
[xsltproc] parsed 2 templates
[xsltproc] parsed 0 templates
[xsltproc] Resolving attribute sets references
[xsltproc] Creating sub-dictionary from stylesheet for transformation
[xsltproc] Registered 0 modules
:
:
[xsltproc] Element mike in namespace 'http://docbook.org/ns/docbook' encountered in chapter, but no template matches.
The log shows the templates are parsed, so the syntax is ok, but then it says "Registered 0 modules", and when it sees the tag in the *.xml file, it then says "no template matches". WHY?
Thanks.
Edit:
xml source:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter [
<!ENTITY % local_ents SYSTEM "file:///local/entities.ent">
<!ENTITY % product_ents SYSTEM "file:///product/entities.ent">
<!ENTITY % common_ents SYSTEM "file:///common/entities.ent">
<!ENTITY % global_ents SYSTEM "file:///global/entities.ent">
%local_ents;
%product_ents;
%common_ents;
%global_ents;
]>
<chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude" version="5.0-extension xes-1.0"
xml:id="Memory">
<title>Memory</title>
<mike/>
<para> This is the
<emphasis role="red" >✓ &agr; &aacgr;</emphasis>
</para>
<para><emphasis role="green">memory section of the report. ✓</emphasis>
</para>
</chapter>
My code is something like:
public static void transform(InputStream in, Source xslt, OutputStream out) throws TransformerException {
//com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer t = tFactory.newTransformer(xslt);
Source xmlSource = new StreamSource(in);
Result outResult = new StreamResult(out);
t.transform(xmlSource, outResult);
}
And when I try to transform my xml:
java.net.MalformedURLException
ERROR: 'Cannot compile stylesheet'
CRITICAL ERROR: 'java.net.MalformedURLException'
:null
javax.xml.transform.TransformerConfigurationException: java.net.MalformedURLException
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(Unknown Source)
at it.unimaticaspa.digipark.utils.XmlUtils.transform(XmlUtils.java:42)
at it.unimaticaspa.digipark.utils.XmlUtilsTest.testTransform(XmlUtilsTest.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.net.MalformedURLException
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(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)
at com.sun.org.apache.xalan.internal.xsltc.compiler.Parser.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.compiler.Parser.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(Unknown Source)
... 27 more
Caused by: java.lang.NullPointerException
... 41 more
at the line:
tFactory.newTransformer(xslt);
I think it's about the fact that both xml and xslt declare namespaces that didn't point to an existing xsd, so i thought to disable the validation of the schema, and i saw the function setAttribute and setFeature, but i can't find any working example, or a list of attributes/features available.
Debugging the code i found that the implementation class of the xml transformer is:
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
-- edit --
As suggested I post my files also:
xml:
<?xml version="1.0" encoding="utf-8"?>
<test:Root xmlns:test="http://www.mysite.it/test/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mysite.it/test/xsdTest.xsd">
<test:Branch>
<test:Leaf>someValue1</test:Leaf>
</test:Branch>
<test:Branch>
<test:Leaf>someValue2</test:Leaf>
<test:Leaf>someValue3</test:Leaf>
</test:Branch>
<test:Branch>
<test:Sub-Branch>
<test:Leaf>someValue4</test:Leaf>
</test:Sub-Branch>
<test:Leaf>someValue5</test:Leaf>
</test:Branch>
</test:Root>
xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0"
xmlns:test="http://www.mysite.it/test/"
xsi:schemaLocation="http://www.unimaticaspa.it/test/xsdTest.xsd">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="test:Root">
<sincro:IdC xmlns:sincro="http://www.uni.com/U3011/sincro/"
xmlns:somenamespace="http://www.mysite.it/mysite-metadata/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.uni.com/U3011sincro/IdC.xsd http://www.mysite.it/mysite-metadata/Metadata.xsd"
sincro:url="http://www.uni.com/U3011/sincro/"
sincro:version="1.0">
<sincro:VdC>
<sincro:ID sincro:scheme="local">asd</sincro:ID>
</sincro:VdC>
<xsl:for-each select="test:Branch">
<sincro:FileGroup>
<sincro:File sincro:encoding="BASE64" sincro:format="TXT">
<sincro:ID>asd</sincro:ID>
<sincro:MoreInfo sincro:XMLScheme="http://www.mysite.it/mysite-metadata/Metadata.xsd">
<sincro:EmbeddedMetadata>
<somenamespace:Metadata>
<somenamespace:mytag>asd</somenamespace:mytag>
</somenamespace:Metadata>
</sincro:EmbeddedMetadata>
</sincro:MoreInfo>
</sincro:File>
</sincro:FileGroup>
</xsl:for-each>
</sincro:IdC>
</xsl:template>
</xsl:stylesheet>
-- EDIT --
added missing declaration: xsi:schemaLocation on tag xsl:stylesheet.
Still doesn't work, it keep giving the same error.
I tried to run my xslt with XMLSpy and it worked fine, i really think that the problem is on the TransformerFactory Configuration.
This is probably because the XSLT Source (system id) is defined by an URL earlier in the code. This URL is malformed (or null maybe, hence null pointer exception in the stacktrace).
XML Namespace names don't have to point to XSDs, or indeed point to anything. They do have to be syntactically correct URIs, and if they're URLs they have to be absolute URLs rather than relative. You haven't shown us your stylesheet, but that's the first thing to look at fixing.
EDITED TO ADD:
Looking at what you've shown us (in the comments on this answer), one error jumps out immediately:
xmlns:test="mysite.it/test/";
Wrong. Namespace names must be absolute URIs, not relative. Change it to
xmlns:test="http://mysite.it/test/";
Also, the semicolons don't belong there. Remove them, and review proper XML syntax.
I am accessing a WebService which give me a valid response. While parsing the response using an XSL Transformation, I am getting SAXParseException. If I tested in the online tools such as freeformatter.com, I am getting a proper parsing without any issues. Any help is greatly appreciated.
The response I have received from the WebService is below
<?xml version="1.0"?><message channel-id="10a60e45-65d4-40c0-826f-1a91d2135da0">
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ns:ITSPResponse xmlns:ns="urn:PegaRULES:SOAP:BNYMDataITSPTest:Services">
<Output>Test IT Service Portal - 1</Output>
</ns:ITSPResponse>
</soap:Body>
</soap:Envelope>
</message>
I am trying to parse the response using XSL Transformation; but receiving an exception. The XSL I am using
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="urn:PegaRULES:SOAP:BNYMDataITSPTest:Services">
<xsl:template match="/">
<message>
<xsl:attribute name="channel-id">
<xsl:value-of select="//#*[local-name()='channel-id']" />
</xsl:attribute>
<send-parameters>
<agent-parameter>
<name>Output</name>
<value> <xsl:value-of select="//*[local-name()='Output']" /> </value>
</agent-parameter>
</send-parameters>
</message>
</xsl:template>
</xsl:stylesheet>
The exception I am getting is
org.xml.sax.SAXParseException: Premature end of file. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124) at com.newscale.bfw.util.XMLValidator.validate(XMLValidator.java:147) at com.newscale.is.core.MessageExecutor.processNSTaskTransportMessage(MessageExecutor.java:135) at com.newscale.is.core.MessageExecutor.processTransportMessage(MessageExecutor.java:431) at com.newscale.is.core.MessageExecutor.processSynchronousOutboundMessage(MessageExecutor.java:526) at com.newscale.is.adk.OutboundAdapterUtil.processSynchronousResponse(OutboundAdapterUtil.java:44) at com.newscale.is.adapter.http.HTTPOutboundAdapter.call(HTTPOutboundAdapter.java:190) at com.newscale.is.adapter.http.HTTPOutboundAdapter.processMessage(HTTPOutboundAdapter.java:147) at com.newscale.is.core.MessageRouter.routeMessage(MessageRouter.java:115) at com.newscale.is.core.MessageExecutor.processOutboundMessage(MessageExecutor.java:604) at com.newscale.is.core.MessageExecutor.processMessage(MessageExecutor.java:125) at com.newscale.is.core.QueueListener.handleTextMessage(QueueListener.java:91) at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:340) at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:237) at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:168) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99) at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:73) at org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:101) at org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:71) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:115) at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:285) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:110) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:71) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:322) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:213) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:71) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86) at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:105) at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:561) at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:499) at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1059) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1051) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:948) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)
I am not sure whether I am missing anything anywhere?
There are two possibilities: Either the document you're reading is ending unexpectedly (and is not well formed), or the stylesheet is ending unexpectedly (and is not well formed). The stylesheet is itself an XML document, after all, and can produce the same exceptions. Looking at the call stack for the exception may help you determine which is true. Running the program under a debugger might also help, by letting you see which URI the parser was trying to read from when it failed.
Or the exception could be coming from parsing some other part of your program and an XML document unrelated to this transformation. Again, look at the exception's call stack, or fire up the program under a debugger, to see what document is causing trouble.
If the parser tells you a file is ending prematurely, it's ending prematurely.
I got this extensions and all I want to know is how I am able to get the news ticker from XML file and how should I create this file?
I tried this one and it is not working.
XML file
http://www.4shared.com/document/uNJ9sdmD/newsxml.html
Extension link
http://extensions.joomla.org/extensions/news-display/articles-display/news-tickers-a-scrollers/6633?qh=YToxMDp7aTowO3M6NDoibmV3cyI7aToxO3M6MzoibmV3IjtpOjI7czo3OiJuZXduZXNzIjtpOjM7czo1OiInbmV3cyI7aTo0O3M6NToibmV3J3MiO2k6NTtzOjY6Im5ld2VseSI7aTo2O3M6NToibmV3cyciO2k6NztzOjY6Im5ld3MnLCI7aTo4O3M6NjoiJ25ldycsIjtpOjk7czo2OiInbmV3cyciO30%3D
First create the XML file and insert it in the correct directory
/modules/mod_highlighter_gk4/xml --> this is where you need to insert the file.
You can find a sample XML file named Sample on that folder which tells you exactly how to format you XML file. It's something like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<highlighter>
<item>
<title>Title 1</title>
<desc>Item description 1</desc>
<link>http://item1.title.com</link>
</item>
<item>
<title>Title 1</title>
<desc>Item description 1</desc>
<link>http://item1.title.com</link>
</item>
On the module itself first make sure you select the XML file on the "data source".
Then on the XML File option put the name of the XML File you created and it should work.
You can find more info from their website as well.
http://www.gavick.com/forums/highlighter.html
My problem is that I want to remove lastfiles and all it's child element using sax with the API of Xerces in c++ language??
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE config>
<config datecreated="20011210">
<user>
John Smith
</user>
<login>jsmith</login>
<password>topsecret</password>
<lastfiles>
<lastfile timestamp="20011210T1002">accounts.txt</lastfile>
<lastfile timestamp="20011190T1132">/home/jsmith/docs/letter.doc</lastfile>
</lastfiles>
</config>