You are absolutely right, I missed one "&". Sorry about that!

This works <binding.atom uri="
http://mywiki/createrssfeed.action?rssType=atom&amp;maxResults=10"/>

Thanks for the quick help and resolution!


On 8/21/07, Raymond Feng <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> We can reproduce the problem without Tuscany code. Did you replace all the
> "&" with "&amp;"?
>
> In the following test case, testXML() fails while testXML1() is
> successful.
>
> Thanks,
> Raymond
>
> import javax.xml.stream.XMLInputFactory;
> import javax.xml.stream.XMLStreamReader;
> import org.junit.Test;
> public class TestXML {
> private static final String xml = "<a uri='http://ns1/root?a=1&b=2&d=3'/
> >";
> private static final String xml1 = "<a
> uri='http://ns1/root?a=1&amp;b=2&amp;d=3'/>";
>
> @Test
> public void testXML() throws Exception {
>     XMLInputFactory factory = XMLInputFactory.newInstance();
>     XMLStreamReader reader = factory.createXMLStreamReader(new
> java.io.StringReader(xml));
>     while (true) {
>         System.out.println(reader.getEventType());
>         if (reader.hasNext()) {
>             reader.next();
>         } else {
>         break;
>         }
>     }
> }
>
> @Test
> public void testXML1() throws Exception {
>     XMLInputFactory factory = XMLInputFactory.newInstance();
>     XMLStreamReader reader = factory.createXMLStreamReader(new
> java.io.StringReader(xml1));
>     while (true) {
>         System.out.println(reader.getEventType());
>         if (reader.hasNext()) {
>             reader.next();
>         } else {
>             break;
>         }
>     }
> }
> }
>
> ----- Original Message -----
> From: "Skip Schuler" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Tuesday, August 21, 2007 3:14 PM
> Subject: Re: Feed binding (atom, rss) breaks when feed URL has parameters
>
>
> > Hi,
> >
> > Unfortunately, escaping with "&amp;" does not work. I get a similar
> > exception... WstxUnexpectedCharException: "Unexpected character '&'"
> (see
> > below).
> >
> > Let me know if you need me to create a bug report in jira.
> >
> > Thanks.
> >
> > Stacktrace:
> >
> > run:
> >     [java] Exception in thread "main"
> > org.osoa.sca.ServiceRuntimeException:
> > org.osoa.sca.ServiceRuntimeException: org.apache
> > .tuscany.sca.contribution.service.ContributionReadException:
> > com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected charact
> > er '&' (code 38); expected a semi-colon after the reference for entity
> > 'maxResults'
> >     [java]  at [row,col {unknown-source}]: [53,95]
> >     [java]     at
> > org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(
> > SCADomain.java:263)
> >     [java]     at
> > org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(
> SCADomain.java
> > :68)
> >     [java]     at feed.SampleServer.main(SampleServer.java:28)
> >     [java] Caused by: org.osoa.sca.ServiceRuntimeException:
> > org.apache.tuscany.sca.contribution.service.ContributionReadExce
> > ption: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected
> character
> > '&' (code 38); expected a semi-colon after the refe
> > rence for entity 'maxResults'
> >     [java]  at [row,col {unknown-source}]: [53,95]
> >     [java]     at
> > org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>(
> > DefaultSCADomain.java:106)
> >     [java]     at
> > org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(
> > SCADomain.java:229)
> >     [java]     ... 2 more
> >     [java] Caused by:
> > org.apache.tuscany.sca.contribution.service.ContributionReadException:
> > com.ctc.wstx.exc.WstxUnexpected
> > CharException: Unexpected character '&' (code 38); expected a semi-colon
> > after the reference for entity 'maxResults'
> >     [java]  at [row,col {unknown-source}]: [53,95]
> >     [java]     at
> > org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(
> > CompositeProcessor.java:308)
> >     [java]     at
> > org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(
> > CompositeProcessor.java:65)
> >     [java]     at
> >
> org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.read
> > (ExtensibleStAXArtifactP
> > rocessor.java:73)
> >     [java]     at
> > org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(
> > CompositeDocumentProcessor.java:63)
> >     [java]     at
> > org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(
> > CompositeDocumentProcessor.java:43)
> >     [java]     at
> >
> org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor.read
> > (ExtensibleURLArtifactPro
> > cessor.java:63)
> >     [java]     at
> >
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.processReadPhase
> > (ContributionServ
> > iceImpl.java:301)
> >     [java]     at
> >
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.addContribution
> > (ContributionServi
> > ceImpl.java:251)
> >     [java]     at
> >
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.contribute
> > (ContributionServiceImp
> > l.java:119)
> >     [java]     at
> > org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>(
> > DefaultSCADomain.java:104)
> >     [java]     ... 3 more
> >     [java] Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException:
> > Unexpected character '&' (code 38); expected a semi-colo
> > n after the reference for entity 'maxResults'
> >     [java]  at [row,col {unknown-source}]: [53,95]
> >     [java]     at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(
> > StreamScanner.java:623)
> >     [java]     at com.ctc.wstx.sr.StreamScanner.parseEntityName(
> > StreamScanner.java:1969)
> >     [java]     at com.ctc.wstx.sr.StreamScanner.fullyResolveEntity(
> > StreamScanner.java:1471)
> >     [java]     at
> > com.ctc.wstx.sr.BasicStreamReader.parseNormalizedAttrValue(
> > BasicStreamReader.java:1943)
> >     [java]     at com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(
> > BasicStreamReader.java:3035)
> >     [java]     at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(
> > BasicStreamReader.java:2934)
> >     [java]     at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(
> > BasicStreamReader.java:2846)
> >     [java]     at com.ctc.wstx.sr.BasicStreamReader.next(
> > BasicStreamReader.java:1019)
> >     [java]     at
> > org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(
> > CompositeProcessor.java:302)
> >     [java]     ... 12 more
> >     [java] Java Result: 1
> >
> > BUILD SUCCESSFUL
> > Total time: 3 seconds
> >
> >
> >
> >
> >
> > On 8/21/07, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:
> >>
> >> Skip Schuler wrote:
> >> > Hi,
> >> >
> >> > I'm not sure it this is a known issue or not, but here's the problem
> >> > I'm
> >> > having with the feeding (atom, rss) binding;
> >> >
> >> > I use the FeedAggregator sample that is shipped with
> >> > tuscany-sca-0.91-incubating. It runs fine out-of-the-box. However if
> I
> >> > change the feed reference to point to a feed that is at a endpoint
> that
> >> has
> >> > URL parameters, it fails (see stacktrace below).
> >> >
> >> > To reproduce:  change the feed2 reference to something like this
> (which
> >> is
> >> > the feed from a confluence site):
> >> >
> >> > <binding.atom uri="
> >> >
> >>
> http://mywiki/spaces/createrssfeed.action?types=page&types=blogpost&types=comment&spaces=&sort=modified&title=Dashboard+RSS+Feed&maxResults=15&publicFeed=false&os_authType=basic&rssType=atom
> >> "/
> >> >
> >> >
> >> >
> >> > Stacktrace:
> >> >
> >> > run:
> >> >      [java] Exception in thread "main"
> >> org.osoa.sca.ServiceRuntimeException:
> >> > org.osoa.sca.ServiceRuntimeException: org.apache
> >> > .tuscany.sca.contribution.service.ContributionReadException:
> >> > com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected charact
> >> > er '=' (code 61); expected a semi-colon after the reference for
> entity
> >> > 'types'
> >> >      [java]  at [row,col {unknown-source}]: [53,91]
> >> >      [java]     at
> >> > org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(
> >> > SCADomain.java:263)
> >> >      [java]     at
> >> > org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(
> >> SCADomain.java
> >> > :68)
> >> >      [java]     at feed.SampleServer.main(SampleServer.java:28)
> >> >      [java] Caused by: org.osoa.sca.ServiceRuntimeException:
> >> > org.apache.tuscany.sca.contribution.service.ContributionReadExce
> >> > ption: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected
> >> character
> >> > '=' (code 61); expected a semi-colon after the refe
> >> > rence for entity 'types'
> >> >      [java]  at [row,col {unknown-source}]: [53,91]
> >> >      [java]     at
> >> > org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>(
> >> > DefaultSCADomain.java:106)
> >> >      [java]     at
> >> > org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(
> >> > SCADomain.java:229)
> >> >      [java]     ... 2 more
> >> >      [java] Caused by:
> >> > org.apache.tuscany.sca.contribution.service.ContributionReadException
> :
> >> > com.ctc.wstx.exc.WstxUnexpected
> >> > CharException: Unexpected character '=' (code 61); expected a
> >> > semi-colon
> >> > after the reference for entity 'types'
> >> >      [java]  at [row,col {unknown-source}]: [53,91]
> >> >      [java]     at
> >> > org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(
> >> > CompositeProcessor.java:308)
> >> >      [java]     at
> >> > org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(
> >> > CompositeProcessor.java:65)
> >> >      [java]     at
> >> >
> >>
> org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.read
> >> > (ExtensibleStAXArtifactP
> >> > rocessor.java:73)
> >> >      [java]     at
> >> > org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(
> >> > CompositeDocumentProcessor.java:63)
> >> >      [java]     at
> >> > org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(
> >> > CompositeDocumentProcessor.java:43)
> >> >      [java]     at
> >> >
> >>
> org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor.read
> >> > (ExtensibleURLArtifactPro
> >> > cessor.java:63)
> >> >      [java]     at
> >> >
> >>
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.processReadPhase
> >> > (ContributionServ
> >> > iceImpl.java:301)
> >> >      [java]     at
> >> >
> >>
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.addContribution
> >> > (ContributionServi
> >> > ceImpl.java:251)
> >> >      [java]     at
> >> >
> >>
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.contribute
> >> > (ContributionServiceImp
> >> > l.java:119)
> >> >      [java]     at
> >> > org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>(
> >> > DefaultSCADomain.java:104)
> >> >      [java]     ... 3 more
> >> >      [java] Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException:
> >> > Unexpected character '=' (code 61); expected a semi-colo
> >> > n after the reference for entity 'types'
> >> >      [java]  at [row,col {unknown-source}]: [53,91]
> >> >      [java]     at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(
> >> > StreamScanner.java:623)
> >> >      [java]     at com.ctc.wstx.sr.StreamScanner.parseEntityName(
> >> > StreamScanner.java:1969)
> >> >      [java]     at com.ctc.wstx.sr.StreamScanner.fullyResolveEntity(
> >> > StreamScanner.java:1471)
> >> >      [java]     at
> >> > com.ctc.wstx.sr.BasicStreamReader.parseNormalizedAttrValue(
> >> > BasicStreamReader.java:1943)
> >> >      [java]     at com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(
> >> > BasicStreamReader.java:3035)
> >> >      [java]     at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(
> >> > BasicStreamReader.java:2934)
> >> >      [java]     at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(
> >> > BasicStreamReader.java:2846)
> >> >      [java]     at com.ctc.wstx.sr.BasicStreamReader.next(
> >> > BasicStreamReader.java:1019)
> >> >      [java]     at
> >> > org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(
> >> > CompositeProcessor.java:302)
> >> >      [java]     ... 12 more
> >> >      [java] Java Result: 1
> >> > BUILD SUCCESSFUL
> >> > Total time: 1 second
> >> >
> >> >
> >> > Thanks!
> >> >
> >> >
> >>
> >> Good catch!
> >>
> >> It looks like it's not an issue with the Feed binding, but a more
> >> general issue with a URL containing "&" in an XML attribute. Could you
> >> try to escape the "&" as "&amp;"? like this:
> >>
> >>
> >>
> http://mywiki/spaces/createrssfeed.action?types=page&amp;types=blogpost&amp;types=comment&amp;spaces=&amp;sort=modified&amp;title=Dashboard+RSS+Feed&amp;maxResults=15&amp;publicFeed=false&amp;os_authType=basic&amp;rssType=atom
> >>
> >> Thanks
> >>
> >> --
> >> Jean-Sebastien
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to