[jira] Created: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

Soren Daugaard (Jira)
Refactor XMLWriter startTag to allow arbitrary attributes to be written
-----------------------------------------------------------------------

                 Key: SOLR-1592
                 URL: https://issues.apache.org/jira/browse/SOLR-1592
             Project: Solr
          Issue Type: Improvement
    Affects Versions: 1.4
         Environment: My MacBook laptop.
            Reporter: Chris A. Mattmann
             Fix For: 1.5
         Attachments: SOLR-1592.Mattmann.112209.patch.txt

There are certain cases in which a user would like to write arbitrary attributes as part of the XML output for a field tag. Case in point: I'd like to declare tags in the SOLR output that are e.g., georss namespace, like georss:point. Other users may want to declare myns:mytag tags, which should be perfectly legal as SOLR goes. This isn't currently possible with the XMLWriter implementation, which curiously only allows the attribute "name" to be included in the XML tags.

Coincidentally, users of XMLWriter aren't allowed to modify the <response outer XML tag to include those arbitrary namespaces (which was my original thought as a workaround for this). This wouldn't matter anyways, because by the time the user got to the FieldType#writeXML method, the header for the XML would have been written anyways.

I've developed a workaround, and in doing so, allowed something that should have probably been allowed in the first place: allow a user to write arbitrary attributes (including xmlns:myns="myuri") as part of the XMLWriter#startTag function. I've kept the existing #startTag, but replaced its innards with versions of startTag that include startTagWithNamespaces, and startTagNoAttrs.



--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

Soren Daugaard (Jira)

     [ https://issues.apache.org/jira/browse/SOLR-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris A. Mattmann updated SOLR-1592:
------------------------------------

    Attachment: SOLR-1592.Mattmann.112209.patch.txt

> Refactor XMLWriter startTag to allow arbitrary attributes to be written
> -----------------------------------------------------------------------
>
>                 Key: SOLR-1592
>                 URL: https://issues.apache.org/jira/browse/SOLR-1592
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.4
>         Environment: My MacBook laptop.
>            Reporter: Chris A. Mattmann
>             Fix For: 1.5
>
>         Attachments: SOLR-1592.Mattmann.112209.patch.txt
>
>
> There are certain cases in which a user would like to write arbitrary attributes as part of the XML output for a field tag. Case in point: I'd like to declare tags in the SOLR output that are e.g., georss namespace, like georss:point. Other users may want to declare myns:mytag tags, which should be perfectly legal as SOLR goes. This isn't currently possible with the XMLWriter implementation, which curiously only allows the attribute "name" to be included in the XML tags.
> Coincidentally, users of XMLWriter aren't allowed to modify the <response outer XML tag to include those arbitrary namespaces (which was my original thought as a workaround for this). This wouldn't matter anyways, because by the time the user got to the FieldType#writeXML method, the header for the XML would have been written anyways.
> I've developed a workaround, and in doing so, allowed something that should have probably been allowed in the first place: allow a user to write arbitrary attributes (including xmlns:myns="myuri") as part of the XMLWriter#startTag function. I've kept the existing #startTag, but replaced its innards with versions of startTag that include startTagWithNamespaces, and startTagNoAttrs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

Soren Daugaard (Jira)
In reply to this post by Soren Daugaard (Jira)

     [ https://issues.apache.org/jira/browse/SOLR-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris A. Mattmann updated SOLR-1592:
------------------------------------

    Attachment: SOLR-1592.Mattmann.112209_02.patch.txt

here's a cleaner version of the patch with a few more methods. I can add javadocs to them to explain them better, but I think this is a lot more flexible than the current methods that exist (see the patch I'm about to attach to SOLR-1586 as evidence).

> Refactor XMLWriter startTag to allow arbitrary attributes to be written
> -----------------------------------------------------------------------
>
>                 Key: SOLR-1592
>                 URL: https://issues.apache.org/jira/browse/SOLR-1592
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.4
>         Environment: My MacBook laptop.
>            Reporter: Chris A. Mattmann
>             Fix For: 1.5
>
>         Attachments: SOLR-1592.Mattmann.112209.patch.txt, SOLR-1592.Mattmann.112209_02.patch.txt
>
>
> There are certain cases in which a user would like to write arbitrary attributes as part of the XML output for a field tag. Case in point: I'd like to declare tags in the SOLR output that are e.g., georss namespace, like georss:point. Other users may want to declare myns:mytag tags, which should be perfectly legal as SOLR goes. This isn't currently possible with the XMLWriter implementation, which curiously only allows the attribute "name" to be included in the XML tags.
> Coincidentally, users of XMLWriter aren't allowed to modify the <response outer XML tag to include those arbitrary namespaces (which was my original thought as a workaround for this). This wouldn't matter anyways, because by the time the user got to the FieldType#writeXML method, the header for the XML would have been written anyways.
> I've developed a workaround, and in doing so, allowed something that should have probably been allowed in the first place: allow a user to write arbitrary attributes (including xmlns:myns="myuri") as part of the XMLWriter#startTag function. I've kept the existing #startTag, but replaced its innards with versions of startTag that include startTagWithNamespaces, and startTagNoAttrs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

Re: [jira] Created: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

hossman
In reply to this post by Soren Daugaard (Jira)

: Refactor XMLWriter startTag to allow arbitrary attributes to be written
        ...
: There are certain cases in which a user would like to write arbitrary
: attributes as part of the XML output for a field tag. Case in point: I'd

...i think here may be a disconnect here between some of the goals you are
describing and the purpose of XMLWriter.  XMLWriter was originally created
to be a wrapper arround a java.io.Writer that had convinent heper methods
for generating a specific XML response format (ie: wt=xml) back before
Solr even supported multiple output types.  The API was never really
designed to be useful for generating XML response data cosisting of
alternate XML structures.

Perhaps instead of making API additions/generalizations to XMLWriter, we
should approach the problem differnelty and think about what a good
reusable general pupose XML generation toolkit that could be used by
custom response writers should look like, and then implement that --
refactoring the existing XMLWriter class to use/extend this new class
where possible?



-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: [jira] Created: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

Mattmann, Chris A (3010)
Hi Chris,

Thanks for the inputs: comments inline below:

>
> ...i think here may be a disconnect here between some of the goals you are
> describing and the purpose of XMLWriter.  XMLWriter was originally created
> to be a wrapper arround a java.io.Writer that had convinent heper methods
> for generating a specific XML response format (ie: wt=xml) back before
> Solr even supported multiple output types.  The API was never really
> designed to be useful for generating XML response data cosisting of
> alternate XML structures.

Good to know -- I'll open up a new issue that includes a patch with javadoc
that states that because it was unclear to me looking at the XMLWriter code.

>
> Perhaps instead of making API additions/generalizations to XMLWriter, we
> should approach the problem differnelty and think about what a good
> reusable general pupose XML generation toolkit that could be used by
> custom response writers should look like, and then implement that --
> refactoring the existing XMLWriter class to use/extend this new class
> where possible?

Potentially -- my problem is, why is XMLWriter a sacred cow? There's not
even a SOLR namespace or DTD to go along with it? Why should users be able
to inject their own custom XML into it -- it would seem that FieldTypes have
the ability to do this anyways (e.g., I can declare any new type of field
and its XML output [without namespaces sure, but still])...

Cheers,
Chris

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: [hidden email]
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Reply | Threaded
Open this post in threaded view
|

Re: [jira] Created: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

hossman

: Potentially -- my problem is, why is XMLWriter a sacred cow? There's not

I'm not trying to suggest that it should be ... my point wasn't to
suggest that we shouldn't modify XMLWriter because it needs to be
preserved as is -- my point was that given XMLWriter's origins, trying to
shoehorn general purpose functionality into it is prbably going to be an
uphill battle, and it might be easier and more beneficial in the long term
to approach the problem from a "what kind of utilities/helper code would
make it easier for people to write custom Response Writers that generate
structures of their own choosing in XML?"

: even a SOLR namespace or DTD to go along with it? Why should users be able
: to inject their own custom XML into it -- it would seem that FieldTypes have
: the ability to do this anyways (e.g., I can declare any new type of field
: and its XML output [without namespaces sure, but still])...

i'm not understanding what you mean ... i'm not fond of the way we have
FieldType.write(XMLWriter xmlWriter, String name, Fieldable f) and
FieldType.write(TextResponseWriter writer, String name, Fieldable f) ...
but those methods don't allow custom fieldtypes to inject arbitrary XML,
they're still confined to the existing XMLWriter and TextResponseWriter
APIs -- those hooks just give the FieldType the ability to call the
approraite write method (writeStr, writeInt, etc...) based on the
inherient type of the data.

-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: [jira] Created: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

Mattmann, Chris A (3010)
Hi Hoss,

Comments inline:

>
> : Potentially -- my problem is, why is XMLWriter a sacred cow? There's not
>
> I'm not trying to suggest that it should be ... my point wasn't to
> suggest that we shouldn't modify XMLWriter because it needs to be
> preserved as is -- my point was that given XMLWriter's origins, trying to
> shoehorn general purpose functionality into it is prbably going to be an
> uphill battle, and it might be easier and more beneficial in the long term
> to approach the problem from a "what kind of utilities/helper code would
> make it easier for people to write custom Response Writers that generate
> structures of their own choosing in XML?"

+1, gotcha.

>
> : even a SOLR namespace or DTD to go along with it? Why should users be able
> : to inject their own custom XML into it -- it would seem that FieldTypes have
> : the ability to do this anyways (e.g., I can declare any new type of field
> : and its XML output [without namespaces sure, but still])...
>
> i'm not understanding what you mean ... i'm not fond of the way we have
> FieldType.write(XMLWriter xmlWriter, String name, Fieldable f) and
> FieldType.write(TextResponseWriter writer, String name, Fieldable f) ...
> but those methods don't allow custom fieldtypes to inject arbitrary XML,
> they're still confined to the existing XMLWriter and TextResponseWriter
> APIs -- those hooks just give the FieldType the ability to call the
> approraite write method (writeStr, writeInt, etc...) based on the
> inherient type of the data.

Sure, but my point was, I am still able to call xmlWriter.writePrim which
lets me write XML tags with unbound names in an arbitrary fashion. In other
words, I can make my field (for XML) instead of spitting out:

<arr name="booya">
   <doc>
     <int name="booya2">2</int>
   ...
   </doc>
</arr>

Spit out:
...
<mycustomtag name="somename">someval</mycustomtag>
...

Using the writePrim method as it stands. So, I'm looking at a near term
solution versus a longer term solution. Your proposal is the correct
long-term solution, for sure. I would imagine then the XmlWriter that exists
would become nothing more than a thin wrapper around our robust
XMLReponseWriter framework that we'll write in order to keep backwards
compat with XmlWriter peeps, no?

Cheers,
Chris


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: [hidden email]
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Reply | Threaded
Open this post in threaded view
|

Re: [jira] Created: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

Yonik Seeley-2-2
In reply to this post by hossman
On Mon, Nov 23, 2009 at 7:04 PM, Chris Hostetter
<[hidden email]> wrote:
> XMLWriter was originally created
> to be a wrapper arround a java.io.Writer that had convinent heper methods
> for generating a specific XML response format (ie: wt=xml) back before
> Solr even supported multiple output types.

Indeed - my longer term plans always included getting rid of it and
re-implementing as a subclass of TextResponseWriter and getting rid of
the XMLWriter set of methods on FieldType:
  /**
   * Renders the specified field as XML
   */
  public abstract void write(XMLWriter xmlWriter, String name,
Fieldable f) throws IOException;

  /**
   * calls back to TextResponseWriter to write the field value
   */
  public abstract void write(TextResponseWriter writer, String name,
Fieldable f) throws IOException;


ResponseWriters in general have always been very expert level... we
change as we need to add new features.
The specific implementations certainly not designed to be subclassed
by users with any back compat guarantees.   People were not even able
to subclass XMLWriter in the past.
http://search.lucidimagination.com/search/document/4d47d6248a54298d/custom_query_response_writer

-Yonik
http://www.lucidimagination.com
Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

Soren Daugaard (Jira)
In reply to this post by Soren Daugaard (Jira)

     [ https://issues.apache.org/jira/browse/SOLR-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noble Paul updated SOLR-1592:
-----------------------------

    Attachment: SOLR-1592.patch

isn't this good enough?

> Refactor XMLWriter startTag to allow arbitrary attributes to be written
> -----------------------------------------------------------------------
>
>                 Key: SOLR-1592
>                 URL: https://issues.apache.org/jira/browse/SOLR-1592
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.4
>         Environment: My MacBook laptop.
>            Reporter: Chris A. Mattmann
>             Fix For: 1.5
>
>         Attachments: SOLR-1592.Mattmann.112209.patch.txt, SOLR-1592.Mattmann.112209_02.patch.txt, SOLR-1592.patch
>
>
> There are certain cases in which a user would like to write arbitrary attributes as part of the XML output for a field tag. Case in point: I'd like to declare tags in the SOLR output that are e.g., georss namespace, like georss:point. Other users may want to declare myns:mytag tags, which should be perfectly legal as SOLR goes. This isn't currently possible with the XMLWriter implementation, which curiously only allows the attribute "name" to be included in the XML tags.
> Coincidentally, users of XMLWriter aren't allowed to modify the <response outer XML tag to include those arbitrary namespaces (which was my original thought as a workaround for this). This wouldn't matter anyways, because by the time the user got to the FieldType#writeXML method, the header for the XML would have been written anyways.
> I've developed a workaround, and in doing so, allowed something that should have probably been allowed in the first place: allow a user to write arbitrary attributes (including xmlns:myns="myuri") as part of the XMLWriter#startTag function. I've kept the existing #startTag, but replaced its innards with versions of startTag that include startTagWithNamespaces, and startTagNoAttrs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

Soren Daugaard (Jira)
In reply to this post by Soren Daugaard (Jira)

     [ https://issues.apache.org/jira/browse/SOLR-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noble Paul updated SOLR-1592:
-----------------------------

    Attachment: SOLR-1592.patch

added a method to write cdata also

> Refactor XMLWriter startTag to allow arbitrary attributes to be written
> -----------------------------------------------------------------------
>
>                 Key: SOLR-1592
>                 URL: https://issues.apache.org/jira/browse/SOLR-1592
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.4
>         Environment: My MacBook laptop.
>            Reporter: Chris A. Mattmann
>             Fix For: 1.5
>
>         Attachments: SOLR-1592.Mattmann.112209.patch.txt, SOLR-1592.Mattmann.112209_02.patch.txt, SOLR-1592.patch, SOLR-1592.patch
>
>
> There are certain cases in which a user would like to write arbitrary attributes as part of the XML output for a field tag. Case in point: I'd like to declare tags in the SOLR output that are e.g., georss namespace, like georss:point. Other users may want to declare myns:mytag tags, which should be perfectly legal as SOLR goes. This isn't currently possible with the XMLWriter implementation, which curiously only allows the attribute "name" to be included in the XML tags.
> Coincidentally, users of XMLWriter aren't allowed to modify the <response outer XML tag to include those arbitrary namespaces (which was my original thought as a workaround for this). This wouldn't matter anyways, because by the time the user got to the FieldType#writeXML method, the header for the XML would have been written anyways.
> I've developed a workaround, and in doing so, allowed something that should have probably been allowed in the first place: allow a user to write arbitrary attributes (including xmlns:myns="myuri") as part of the XMLWriter#startTag function. I've kept the existing #startTag, but replaced its innards with versions of startTag that include startTagWithNamespaces, and startTagNoAttrs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

Re: [jira] Created: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

hossman
In reply to this post by Mattmann, Chris A (3010)

: Sure, but my point was, I am still able to call xmlWriter.writePrim which
: lets me write XML tags with unbound names in an arbitrary fashion. In other
: words, I can make my field (for XML) instead of spitting out:

Oh man ... WTF is writePrim doing marked "public" ?!?!?!?!

...this is why classes shouldn't be made public without a thorough
vetting.

I see your point now abotu FieldTypes having an awkward amount of control
over the XML generateion ... all i can say is they arent' suppose to have
*any* control, it's suppose to be a field type nuetral format that only
allows the FieldTypes to render themselves as one of the "returnable
object" types defined as being permited in the SolrQueryResponse...

http://lucene.apache.org/solr/api/org/apache/solr/request/SolrQueryResponse.html


-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: [jira] Created: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

hossman
In reply to this post by Yonik Seeley-2-2

: Indeed - my longer term plans always included getting rid of it and
: re-implementing as a subclass of TextResponseWriter and getting rid of
: the XMLWriter set of methods on FieldType:

My opinion: that's not going far enough.

Ryan was on the right track when he introduced FieldType.toObject --
ResponseWRiters (and any other future client APIs) should use those
methods to render the stored values as Objects, and then make their own
choices as to how to serialize those objects ... that puts the response
writer in control of ensuring that some custom FieldType doesn't fuck up
the response -- it either returns an object that the ResposeWriter can
deal with, or it doesn't, in which canse the response writer can do
whatever it wants (call toString and use that, ignore, error, etc...)

: by users with any back compat guarantees.   People were not even able
: to subclass XMLWriter in the past.

...people still aren't able to subclass it. it's final.


-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: [jira] Created: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

Noble Paul നോബിള്‍  नोब्ळ्-2
In reply to this post by Yonik Seeley-2-2
Why don't we make the response writers deal w/ SolrDocument instead of
lucene Document? That way we can get rid of a lot of ugly code.
SOLR-1516 enables responsewriters to do that

On Tue, Nov 24, 2009 at 6:44 AM, Yonik Seeley
<[hidden email]> wrote:

> On Mon, Nov 23, 2009 at 7:04 PM, Chris Hostetter
> <[hidden email]> wrote:
>> XMLWriter was originally created
>> to be a wrapper arround a java.io.Writer that had convinent heper methods
>> for generating a specific XML response format (ie: wt=xml) back before
>> Solr even supported multiple output types.
>
> Indeed - my longer term plans always included getting rid of it and
> re-implementing as a subclass of TextResponseWriter and getting rid of
> the XMLWriter set of methods on FieldType:
>  /**
>   * Renders the specified field as XML
>   */
>  public abstract void write(XMLWriter xmlWriter, String name,
> Fieldable f) throws IOException;
>
>  /**
>   * calls back to TextResponseWriter to write the field value
>   */
>  public abstract void write(TextResponseWriter writer, String name,
> Fieldable f) throws IOException;
>
>
> ResponseWriters in general have always been very expert level... we
> change as we need to add new features.
> The specific implementations certainly not designed to be subclassed
> by users with any back compat guarantees.   People were not even able
> to subclass XMLWriter in the past.
> http://search.lucidimagination.com/search/document/4d47d6248a54298d/custom_query_response_writer
>
> -Yonik
> http://www.lucidimagination.com
>



--
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

Soren Daugaard (Jira)
In reply to this post by Soren Daugaard (Jira)

    [ https://issues.apache.org/jira/browse/SOLR-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782767#action_12782767 ]

Chris A. Mattmann commented on SOLR-1592:
-----------------------------------------

Hey Noble:

I like your latest patch. My +1 on it -- it meets my use case (and what I'm doing with SOLR-1586). I'll attach a new patch for SOLR-1586 that uses this code if you are OK to commit it.

Cheers,
Chris


> Refactor XMLWriter startTag to allow arbitrary attributes to be written
> -----------------------------------------------------------------------
>
>                 Key: SOLR-1592
>                 URL: https://issues.apache.org/jira/browse/SOLR-1592
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.4
>         Environment: My MacBook laptop.
>            Reporter: Chris A. Mattmann
>             Fix For: 1.5
>
>         Attachments: SOLR-1592.Mattmann.112209.patch.txt, SOLR-1592.Mattmann.112209_02.patch.txt, SOLR-1592.patch, SOLR-1592.patch
>
>
> There are certain cases in which a user would like to write arbitrary attributes as part of the XML output for a field tag. Case in point: I'd like to declare tags in the SOLR output that are e.g., georss namespace, like georss:point. Other users may want to declare myns:mytag tags, which should be perfectly legal as SOLR goes. This isn't currently possible with the XMLWriter implementation, which curiously only allows the attribute "name" to be included in the XML tags.
> Coincidentally, users of XMLWriter aren't allowed to modify the <response outer XML tag to include those arbitrary namespaces (which was my original thought as a workaround for this). This wouldn't matter anyways, because by the time the user got to the FieldType#writeXML method, the header for the XML would have been written anyways.
> I've developed a workaround, and in doing so, allowed something that should have probably been allowed in the first place: allow a user to write arbitrary attributes (including xmlns:myns="myuri") as part of the XMLWriter#startTag function. I've kept the existing #startTag, but replaced its innards with versions of startTag that include startTagWithNamespaces, and startTagNoAttrs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

Soren Daugaard (Jira)
In reply to this post by Soren Daugaard (Jira)

    [ https://issues.apache.org/jira/browse/SOLR-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782769#action_12782769 ]

Noble Paul commented on SOLR-1592:
----------------------------------

committed r884411
Thanks Mattman

> Refactor XMLWriter startTag to allow arbitrary attributes to be written
> -----------------------------------------------------------------------
>
>                 Key: SOLR-1592
>                 URL: https://issues.apache.org/jira/browse/SOLR-1592
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.4
>         Environment: My MacBook laptop.
>            Reporter: Chris A. Mattmann
>             Fix For: 1.5
>
>         Attachments: SOLR-1592.Mattmann.112209.patch.txt, SOLR-1592.Mattmann.112209_02.patch.txt, SOLR-1592.patch, SOLR-1592.patch
>
>
> There are certain cases in which a user would like to write arbitrary attributes as part of the XML output for a field tag. Case in point: I'd like to declare tags in the SOLR output that are e.g., georss namespace, like georss:point. Other users may want to declare myns:mytag tags, which should be perfectly legal as SOLR goes. This isn't currently possible with the XMLWriter implementation, which curiously only allows the attribute "name" to be included in the XML tags.
> Coincidentally, users of XMLWriter aren't allowed to modify the <response outer XML tag to include those arbitrary namespaces (which was my original thought as a workaround for this). This wouldn't matter anyways, because by the time the user got to the FieldType#writeXML method, the header for the XML would have been written anyways.
> I've developed a workaround, and in doing so, allowed something that should have probably been allowed in the first place: allow a user to write arbitrary attributes (including xmlns:myns="myuri") as part of the XMLWriter#startTag function. I've kept the existing #startTag, but replaced its innards with versions of startTag that include startTagWithNamespaces, and startTagNoAttrs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

Soren Daugaard (Jira)
In reply to this post by Soren Daugaard (Jira)

    [ https://issues.apache.org/jira/browse/SOLR-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782773#action_12782773 ]

Chris A. Mattmann commented on SOLR-1592:
-----------------------------------------

Thanks, Noble! This works for me. +1 to resolve...

I'll attach a patch to SOLR-1586 that leverages this new code...

> Refactor XMLWriter startTag to allow arbitrary attributes to be written
> -----------------------------------------------------------------------
>
>                 Key: SOLR-1592
>                 URL: https://issues.apache.org/jira/browse/SOLR-1592
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.4
>         Environment: My MacBook laptop.
>            Reporter: Chris A. Mattmann
>             Fix For: 1.5
>
>         Attachments: SOLR-1592.Mattmann.112209.patch.txt, SOLR-1592.Mattmann.112209_02.patch.txt, SOLR-1592.patch, SOLR-1592.patch
>
>
> There are certain cases in which a user would like to write arbitrary attributes as part of the XML output for a field tag. Case in point: I'd like to declare tags in the SOLR output that are e.g., georss namespace, like georss:point. Other users may want to declare myns:mytag tags, which should be perfectly legal as SOLR goes. This isn't currently possible with the XMLWriter implementation, which curiously only allows the attribute "name" to be included in the XML tags.
> Coincidentally, users of XMLWriter aren't allowed to modify the <response outer XML tag to include those arbitrary namespaces (which was my original thought as a workaround for this). This wouldn't matter anyways, because by the time the user got to the FieldType#writeXML method, the header for the XML would have been written anyways.
> I've developed a workaround, and in doing so, allowed something that should have probably been allowed in the first place: allow a user to write arbitrary attributes (including xmlns:myns="myuri") as part of the XMLWriter#startTag function. I've kept the existing #startTag, but replaced its innards with versions of startTag that include startTagWithNamespaces, and startTagNoAttrs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

Soren Daugaard (Jira)
In reply to this post by Soren Daugaard (Jira)

     [ https://issues.apache.org/jira/browse/SOLR-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noble Paul resolved SOLR-1592.
------------------------------

    Resolution: Fixed

> Refactor XMLWriter startTag to allow arbitrary attributes to be written
> -----------------------------------------------------------------------
>
>                 Key: SOLR-1592
>                 URL: https://issues.apache.org/jira/browse/SOLR-1592
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.4
>         Environment: My MacBook laptop.
>            Reporter: Chris A. Mattmann
>            Assignee: Noble Paul
>             Fix For: 1.5
>
>         Attachments: SOLR-1592.Mattmann.112209.patch.txt, SOLR-1592.Mattmann.112209_02.patch.txt, SOLR-1592.patch, SOLR-1592.patch
>
>
> There are certain cases in which a user would like to write arbitrary attributes as part of the XML output for a field tag. Case in point: I'd like to declare tags in the SOLR output that are e.g., georss namespace, like georss:point. Other users may want to declare myns:mytag tags, which should be perfectly legal as SOLR goes. This isn't currently possible with the XMLWriter implementation, which curiously only allows the attribute "name" to be included in the XML tags.
> Coincidentally, users of XMLWriter aren't allowed to modify the <response outer XML tag to include those arbitrary namespaces (which was my original thought as a workaround for this). This wouldn't matter anyways, because by the time the user got to the FieldType#writeXML method, the header for the XML would have been written anyways.
> I've developed a workaround, and in doing so, allowed something that should have probably been allowed in the first place: allow a user to write arbitrary attributes (including xmlns:myns="myuri") as part of the XMLWriter#startTag function. I've kept the existing #startTag, but replaced its innards with versions of startTag that include startTagWithNamespaces, and startTagNoAttrs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

Soren Daugaard (Jira)
In reply to this post by Soren Daugaard (Jira)

     [ https://issues.apache.org/jira/browse/SOLR-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noble Paul reassigned SOLR-1592:
--------------------------------

    Assignee: Noble Paul

> Refactor XMLWriter startTag to allow arbitrary attributes to be written
> -----------------------------------------------------------------------
>
>                 Key: SOLR-1592
>                 URL: https://issues.apache.org/jira/browse/SOLR-1592
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.4
>         Environment: My MacBook laptop.
>            Reporter: Chris A. Mattmann
>            Assignee: Noble Paul
>             Fix For: 1.5
>
>         Attachments: SOLR-1592.Mattmann.112209.patch.txt, SOLR-1592.Mattmann.112209_02.patch.txt, SOLR-1592.patch, SOLR-1592.patch
>
>
> There are certain cases in which a user would like to write arbitrary attributes as part of the XML output for a field tag. Case in point: I'd like to declare tags in the SOLR output that are e.g., georss namespace, like georss:point. Other users may want to declare myns:mytag tags, which should be perfectly legal as SOLR goes. This isn't currently possible with the XMLWriter implementation, which curiously only allows the attribute "name" to be included in the XML tags.
> Coincidentally, users of XMLWriter aren't allowed to modify the <response outer XML tag to include those arbitrary namespaces (which was my original thought as a workaround for this). This wouldn't matter anyways, because by the time the user got to the FieldType#writeXML method, the header for the XML would have been written anyways.
> I've developed a workaround, and in doing so, allowed something that should have probably been allowed in the first place: allow a user to write arbitrary attributes (including xmlns:myns="myuri") as part of the XMLWriter#startTag function. I've kept the existing #startTag, but replaced its innards with versions of startTag that include startTagWithNamespaces, and startTagNoAttrs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

Re: [jira] Created: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

Age Jan Kuperus-2
In reply to this post by hossman
Chris Hostetter wrote:
> Perhaps instead of making API additions/generalizations to XMLWriter, we
> should approach the problem differnelty and think about what a good
> reusable general pupose XML generation toolkit that could be used by
> custom response writers should look like, and then implement that --
> refactoring the existing XMLWriter class to use/extend this new class
> where possible?

I agree completely. Looking at solr/lucene from an XML/XSLT/X... background my first impression
is that the XML/XSLT features are just what is absolutely necessary to get it running. As we are
going to use solr in an XML based environment, we'll be happy to exchange ideas about "full" (or
at least "more" xml support.



--
Age Jan Kuperus
FB ICT / Wageningen UR Library

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-1592) Refactor XMLWriter startTag to allow arbitrary attributes to be written

Soren Daugaard (Jira)
In reply to this post by Soren Daugaard (Jira)

    [ https://issues.apache.org/jira/browse/SOLR-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784507#action_12784507 ]

Lance Norskog commented on SOLR-1592:
-------------------------------------

Please add unit tests and test against the XSLTResponseWriter. In particular please check namespace handling with XSL.

Do the other responsewriters care about attributes?

> Refactor XMLWriter startTag to allow arbitrary attributes to be written
> -----------------------------------------------------------------------
>
>                 Key: SOLR-1592
>                 URL: https://issues.apache.org/jira/browse/SOLR-1592
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.4
>         Environment: My MacBook laptop.
>            Reporter: Chris A. Mattmann
>            Assignee: Noble Paul
>             Fix For: 1.5
>
>         Attachments: SOLR-1592.Mattmann.112209.patch.txt, SOLR-1592.Mattmann.112209_02.patch.txt, SOLR-1592.patch, SOLR-1592.patch
>
>
> There are certain cases in which a user would like to write arbitrary attributes as part of the XML output for a field tag. Case in point: I'd like to declare tags in the SOLR output that are e.g., georss namespace, like georss:point. Other users may want to declare myns:mytag tags, which should be perfectly legal as SOLR goes. This isn't currently possible with the XMLWriter implementation, which curiously only allows the attribute "name" to be included in the XML tags.
> Coincidentally, users of XMLWriter aren't allowed to modify the <response outer XML tag to include those arbitrary namespaces (which was my original thought as a workaround for this). This wouldn't matter anyways, because by the time the user got to the FieldType#writeXML method, the header for the XML would have been written anyways.
> I've developed a workaround, and in doing so, allowed something that should have probably been allowed in the first place: allow a user to write arbitrary attributes (including xmlns:myns="myuri") as part of the XMLWriter#startTag function. I've kept the existing #startTag, but replaced its innards with versions of startTag that include startTagWithNamespaces, and startTagNoAttrs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

12