This is what I have in the code but it's still not diaplaying any messages.
However, I did get rid of that Name Sapce Manager Error message though.
Thank you. Can you please have a look again at my code and tell me what I'm
doing wrong here. Thanks a million. I'm trying to set up a XML file for
capturing all messages string for futuer localization usages.
Thanks, Alpha
try
{
unityMessages = new
XPathDocument(@"C:\PROJECTS\PPGLOBAL\UnityMessages.xml");
unityMsgNavigator = unityMessages.CreateNavigator();
string query =
@"/trans-unit[@id=""m1""]/target[lang(""fr"")]";
XPathExpression queryM1 = unityMsgNavigator.Compile(query);
XPathNodeIterator ni =
(XPathNodeIterator)unityMsgNavigator.Evaluate(queryM1);
while (ni.MoveNext())
{
MessageBox.Show(ni.Current.ToString());
}
This is what I have in the xml file:
<?xml version="1.0" encoding="utf-8" ?>
<xliff version="1.1">
<trans-unit id="m1">
<source xml:lang="en-us">Error populating the children nodes of the
selected node.</source>
<target xml:lang="fr">Translation of "Vous le vou coucher avec moi
sesua?"</target>
</trans-unit>
</xliff>
[quoted text, click to view] "Martin Honnen" wrote:
>
>
> Alpha wrote:
>
> > I created the following code in my C# program but it's giving me error
> > message at run time of :
> >
> > XML.XPATH.XPATHEXCEPTION : Namespace Manager or XSLTContext needed. This
> > query has a prefix, variable or user defined function.
>
>
> > string query = @"/trans-unit[@id=""m1""]/target[@xml:lang=""fr""]";
>
> You are using the prefix xml in the attribute name xml:lang without
> using a namespace manager.
> Either use a namespace manager or simply do
> string query = @"/trans-unit[@id=""m1""]/target[lang(""fr"")]"
>
> --
>
> Martin Honnen --- MVP XML
>
http://JavaScript.FAQTs.com/