my xml file showing error saying - "Content is not allowed in trailing section." - android-contentresolver

my xml file showing error saying - "Content is not allowed in trailing section." on eclipse.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">MyContentProvider</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
</resources>;
How to resolve it ?

Remove semicolon ; at the end:
</resources>;
change into:
</resources>

Related

What is wrong with my layer.xml from netbeans?

I try to create a new palette in netbeans 10, but the following 2 errors don't allow me to compile the project:
Document root element "folder", must match DOCTYPE root "JavaPalette". [3]
The markup in the document following the root element must be well-formed. [11]
My XML looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
<folder name="JavaPalette">
<folder name="Items">
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.javasourcefilepalette.Bundle"/>
<file name="Item.xml" url="resources/Item.xml">
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.javasourcefilepalette.Bundle"/>
</file>
</folder>
</folder>
<filesystem/>
I have no clue what both error messages mean, but i did exactly what is said in the tutorial.
Online validation of the xml file also shows that error.
https://platform.netbeans.org/tutorials/nbm-palette-api2.html
I didn´t followed the tutorial, but as far as i can tell, your filesystem tag is not valid. If you take a look at the DTD you can see that the element filesystem isn´t declared as EMPTY (for more information you can read more about it here). So you have to provide a start and end tag. In your posted example you are only using <filesystem/> which isn´t allowed.
You have to change the xml as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
<filesystem>
<folder name="JavaPalette">
<folder name="Items">
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.javasourcefilepalette.Bundle"/>
<file name="Item.xml" url="resources/Item.xml">
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.javasourcefilepalette.Bundle"/>
</file>
</folder>
</folder>
</filesystem>

How to read xml value with Powershell

<?xml version="1.0" encoding="utf-8"?>
<Foo>
<Tier Path="\\10.10.44.61\Case Study\" />
<Force Path="\\10.10.44.61\Orto Study" Atomic="False" />
</Foo>
How can I read in powershell Tier Path value?
I am expecting to get the value of \\10.10.44.61\Case Study\
$xml = '<?xml version="1.0" encoding="utf-8"?>
<Foo>
<Tier Path="\\10.10.44.61\Case Study\" />
<Force Path="\\10.10.44.61\Orto Study" Atomic="False" />
</Foo>'
([xml]$xml).Foo.Tier.Path
As long as you are using an xml type (which I do by casting) you can reference the path directly as members of the object.

Remove Home element from navigation in Zend_Navigation

Can I remove the Home element from the XML file containing menus.
<?xml version="1.0" encoding="UTF-8"?>
<configdata>
<nav>
<label>HOME</label>
<controller>index</controller>
<action>index</action>
<id>root</id>
<pages>...</pages>
....
When I delete it from the xml file (from line 4 to 7), I get an exception
Zend_Navigation_Exception: Invalid argument: Unable to determine class to instantiate in C:\www\project\library\Zend\Navigation\Page.php on line 235
Well , you remove lines related to Home element in addition to the <nav> tag !!!
and then XML file becomes
<?xml version="1.0" encoding="UTF-8"?>
<configdata>
<menu1>...</menu1>
<menu2>...</menu2>
...
</configdata>

Namespace/Mymodule/Block/Item.php file code not accessible on frontend after adding through xml

i am working on a module e.g "Mymodule", in which i need to filter the results. i.e. for Partners i created Partner.php and for Community i created Community.php in
Mymodule/Block/Partner.php
Mymodule/Block/Community.php
Now i wanted to access their code in frontend through Mymodule.XML
<block type="mymodule/partner" ......................... />
but this doesn't work on LIVE SERVER, although it does work on local Wamp server :( ... Any idea ?
Although when i access the default Mymodule.php code in the same and add the code i placed in partner and community file, it does work.
Is there something i am missing ?
First, you have to define the blocks in your module's config.xml:
<config>
<global>
<blocks>
<mymodule>
<class>Namespace_Mymodule_Block</class>
</mymodule>
</blocks>
</global>
</config>
Second, you have to use the right block type in your layout XML:
<block type="mymodule/partner" ......................... />
You must not write ".php" in the block type. Note, that the term "mymodule" has to be the same in the config xml as well as in the block type.
Hope this helps!
I'm not strictly sure how your code would ever have worked. But assuming you haven't built a module before, you'll need a minimum of 3 files.
app/etc/modules/Sonassi_Module.xml
app/code/community/Sonassi/Module/etc/config.xml
app/code/community/Sonassi/Module/Block/Partner.php
In the first file ... app/etc/modules/Sonassi_Module.xml
<?xml version="1.0"?>
<config>
<modules>
<Sonassi_Module>
<active>true</active>
<codePool>community</codePool>
</Sonassi_Module>
</modules>
</config>
In the second file ... app/code/community/Sonassi/Module/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Sonassi_Module>
<version>0.1.0</version>
</Sonassi_Module>
</modules>
<frontend>
<routers>
<module>
<use>standard</use>
<args>
<module>Sonassi_Module</module>
<frontName>module</frontName>
</args>
</module>
</routers>
</frontend>
<global>
<blocks>
<module>
<class>Sonassi_Module_Block</class>
</module>
</blocks>
</global>
</config>
In the third file ... app/code/community/Sonassi/Module/Block/Partner.php
class Sonassi_Module_Block_Partner extends Core_Block_Template
{
}
Then finally, you can then use
<block type="module/partner" ......................... />

Reading values from property file through NANT

How can I read a value alone from the property file. For example, how can I read the values of build.home or temp.dir from the below example.
contents of env.properties
build.home=c:\build
temp.dir=c:\temp
Regards
Sarathy
We do this in a slightly different format for Nant.
In your build file:
<include buildfile="./env.properties" failonerror="true"/>
env.properties:
<?xml version="1.0" ?>
<project>
<property name="build.home" value="c:/build"/>
<property name="temp.dir" value="c:/temp"/>
</project>