[
https://issues.apache.org/jira/browse/ABDERA-198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
machune reopened ABDERA-198:
----------------------------
Your code is different from my code.
in OpenSearchExtensionFactory, the ITEMS_PER_PAGE declaration is:
static final QName ITEMS_PER_PAGE = new QName(OPENSEARCH_NS, ITEMS_PER_PAGE_LN,
OS_PREFIX);
But in my code
final QName Items_Per_Pages_QN = new QName(OpenSearch_NS,"itemsPerPage");
I don't declare a prefix for the opensearch namespace. If I add prefix of
namespace in the Items_Per_Pages_QN declaration, I.E.
final QName Items_Per_Pages_QN = new QName(OpenSearch_NS,"itemsPerPage","os");
it works well.
So I guess, the problem should lie in the namespace declaration when calling
addExtension() function, maybe you did the check of prefix when declare a
namespace. But it isn't true. For a namespace, it is ok if no prefix is
specified for a namespace URI.
> Done't declare namespace correctly when calling addSimpleExtension(QName,
> String) many times to add a set of extension elements with same namespace.
> -----------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: ABDERA-198
> URL: https://issues.apache.org/jira/browse/ABDERA-198
> Project: Abdera
> Issue Type: Bug
> Affects Versions: 0.3.0
> Reporter: machune
>
> Code snapshot is as follows:
> final String OpenSearch_NS = "http://a9.com/-/spec/opensearch/1.1/";
> final String Total_Results = "totalResults";
> final QName Total_Results_QN = new QName(OpenSearch_NS,"totalResults");
> final String Items_Per_Pages = "itemsPerPage";
> final QName Items_Per_Pages_QN = new QName(OpenSearch_NS,"itemsPerPage");
> final int Item_Num_Per_Pages = 200;
> Feed newFeed = new Abdera().newFeed();
> newFeed.addSimpleExtension(Total_Results_QN,String.valueOf(getEntriesCount()));
> newFeed.addSimpleExtension(Items_Per_Pages_QN,String.valueOf(Item_Num_Per_Pages));
> the result is:
> <feed xmlns="http://www.w3.org/2005/Atom">
> <totalResults xmlns="http://a9.com/-/spec/opensearch/1.1/">23</totalResults >
> <itemsPerPage>200</itemsPerPage>
> </feed>
> the element "itemsPerPage" has not correct namespace declaration.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.