2011-10-23 1 views
0

여기에 가장 큰 문제는 검색 URL과 함께 : 그것은 ? 기호를 포함하지 않는GAE 문서 용 Firefox 검색 플러그인을 만드는 방법은 무엇입니까?

http://code.google.com/intl/it/query/#p=appengine&q=query

, 또한이 # 기호가 있습니다. 이러한 URL은 XML 유효성 검사를 통과하지 못하므로 다른 매개 변수를 포함하여 다른 방법을 시도했지만 작동하는 해결책을 찾지 못했습니다.

<?xml version="1.0" encoding="UTF-8"?> 
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" 
         xmlns:moz="http://www.mozilla.org/2006/browser/search/"> 
    <ShortName>Google AppEngine</ShortName> 
    <Description>Search the GAE documents at Google Code website.</Description> 
    <InputEncoding>UTF-8</InputEncoding> 
    <Image width="16" height="16" type="image/x-icon">data:image/x-icon;base64,...</Image> 
    <Url type="text/html" method="GET" template="http://code.google.com/intl/it/query/#p=appengine"> 
    <Param name="a" value="{moz:locale}"/> 
    <Param name="q" value="{searchTerms}"/> 
    </Url> 
    <moz:SearchForm>http://code.google.com/intl/it/appengine/docs/</moz:SearchForm> 
</OpenSearchDescription> 

답변

1

사용 엔티티 &amp;&를 인코딩 및 XML이 유효합니다 :

<?xml version="1.0" encoding="UTF-8"?> 
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" 
         xmlns:moz="http://www.mozilla.org/2006/browser/search/"> 
    <ShortName>Google AppEngine</ShortName> 
    <Description>Search the GAE documents at Google Code website.</Description> 
    <InputEncoding>UTF-8</InputEncoding> 
    <Image width="16" height="16" type="image/x-icon">data:image/x-icon;base64,25</Image> 
    <Url type="text/html" method="GET" template="http://code.google.com/intl/it/query/#p=appengine&amp;q={searchTerms}"></Url> 
    <moz:SearchForm>http://code.google.com/intl/it/appengine/docs/</moz:SearchForm> 
</OpenSearchDescription> 

복사이 여기

내가 (이미지 부분이 단순화를 위해 잘립니다) 현재 가지고있는 것입니다 XML을 http://validator.w3.org/check으로 입력하여 유효성을 확인하십시오.

관련 문제