tags in string.xml in android Xliff:g (reprint)

Source: Internet
Author: User
Tags xml parser

Transferred from: http://blog.csdn.net/xuewater/article/details/25687987

When writing a string in a resource file, if the string is dynamic and indeterminate, we can use the xliff:g tag, but The resource file I wrote has always been wrong, such as:

<string name="chronometer_initial_format">initial format: <xliff:g ID ="initial-format">%1$s </xliff:g></string>


The error hint is: Error:error parsing xml:unbound prefix, the first thought is the format string%1 $ s problem, removed the%1 $ s error remains.
It will then directly

<xliff:g id="initial-format">%1$s </xliff:g>

Get rid of, the mistake is gone. Even so, that error should be related to Xliff:g, which is linked to the error prompt: "Parsing XML error: No binding prefix".

That is, Xliff does not have a binding and no declaration, the XML parser cannot parse it, it is the declaration of the Xliff namespace less (see below)

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"

tags in string.xml in android Xliff:g (reprint)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.