tis707
December 9th, 2008, 11:17 PM
Hi all i have xml file need to change that with diffrent languages
<?xml version="1.0" encoding="utf-8" standalone="yes" ?><WebEditorDocument><Template Name="Test"/><Data><Paragraph Format="Text">The graph applies to a cleaning bend with cleaning cap and with the same dimension of take-off and main duct (Ød<Subscript>3</Subscript>=Ød<Subscript>1</Subscript>).</Paragraph><Paragraph Format="Text2">The pressure drop is about 30% lower for cleaning cap and Ød<Subscript>3</Subscript>=Ød<Subscript>1</Subscript>.</Paragraph><Paragraph Format="Text2">The pressure drop is about 30% lower for cleaning cap and one step smaller take-off dimension (Ød<Subscript>3 </Subscript>< Ød<Subscript>1</Subscript>).</Paragraph><Paragraph Format="Text2">The pressure drop is about 50% lower for cleaning cap KCU and one step smaller take-off dimension (Ød<Subscript>3 </Subscript>< Ød<Subscript>1</Subscript>).</Paragraph></Data></WebEditorDocument>
And after the translation the value in the text file should be
<?xml version="1.0" encoding="utf-8" standalone="yes" ?><WebEditorDocument><Template Name="Test"/><Data><Paragraph Format="Text">Diagrammet avser rensbar böj med renslucka samt med samma dimension på stos och huvudrör (Ød<Subscript>3</Subscript> = Ød<Subscript>1</Subscript>).</Paragraph><Paragraph Format="Text2">För renslucka samt Ød<Subscript>3</Subscript> = Ød<Subscript>1</Subscript>, är tryckfallet ca 30% <Break/>lägre.</Paragraph><Paragraph Format="Text">För renslucka samt ett stegs mindre stosdimension (Ød<Subscript>3</Subscript> < Ød<Subscript>1</Subscript>) är tryckfallet ca 30% lägre.</Paragraph><Paragraph Format="Text">För renslucka samt ett stegs mindre stosdimension (Ød<Subscript>3</Subscript> < Ød<Subscript>1</Subscript>) är tryckfallet ca 50% lägre.</Paragraph></Data></WebEditorDocument>
i tried to read the file
try
{
StringReader srXmlValue = new StringReader(param.ParamValue.Replace("<Break/>", Environment.NewLine));
XmlTextReader trXmlValue = new XmlTextReader(srXmlValue);
while (trXmlValue.Read())
{
switch (trXmlValue.NodeType)
{
case XmlNodeType.Element: // The node is an element.
if (trXmlValue.Name.Trim().ToLower() == "paragraph")
{
txtParamValue.Text += String.Format("[###Paragraph-{0}###]", trXmlValue["Format"]);
txtParamValue.Text += Environment.NewLine;
}
break;
case XmlNodeType.Text: //Display the text in each element.
txtParamValue.Text += Environment.NewLine;
txtParamValue.Text += trXmlValue.Value;
// txtParamValue.Text += Environment.NewLine;
// txtParamValue.Text += Environment.NewLine;
break;
}
}
}
catch
{
txtParamValue.Text = param.ParamValue;
}
but getting problem near <subscript>3</subscript>,
i have to show the entire text in paragraph tag in richtextbox
thanks
<?xml version="1.0" encoding="utf-8" standalone="yes" ?><WebEditorDocument><Template Name="Test"/><Data><Paragraph Format="Text">The graph applies to a cleaning bend with cleaning cap and with the same dimension of take-off and main duct (Ød<Subscript>3</Subscript>=Ød<Subscript>1</Subscript>).</Paragraph><Paragraph Format="Text2">The pressure drop is about 30% lower for cleaning cap and Ød<Subscript>3</Subscript>=Ød<Subscript>1</Subscript>.</Paragraph><Paragraph Format="Text2">The pressure drop is about 30% lower for cleaning cap and one step smaller take-off dimension (Ød<Subscript>3 </Subscript>< Ød<Subscript>1</Subscript>).</Paragraph><Paragraph Format="Text2">The pressure drop is about 50% lower for cleaning cap KCU and one step smaller take-off dimension (Ød<Subscript>3 </Subscript>< Ød<Subscript>1</Subscript>).</Paragraph></Data></WebEditorDocument>
And after the translation the value in the text file should be
<?xml version="1.0" encoding="utf-8" standalone="yes" ?><WebEditorDocument><Template Name="Test"/><Data><Paragraph Format="Text">Diagrammet avser rensbar böj med renslucka samt med samma dimension på stos och huvudrör (Ød<Subscript>3</Subscript> = Ød<Subscript>1</Subscript>).</Paragraph><Paragraph Format="Text2">För renslucka samt Ød<Subscript>3</Subscript> = Ød<Subscript>1</Subscript>, är tryckfallet ca 30% <Break/>lägre.</Paragraph><Paragraph Format="Text">För renslucka samt ett stegs mindre stosdimension (Ød<Subscript>3</Subscript> < Ød<Subscript>1</Subscript>) är tryckfallet ca 30% lägre.</Paragraph><Paragraph Format="Text">För renslucka samt ett stegs mindre stosdimension (Ød<Subscript>3</Subscript> < Ød<Subscript>1</Subscript>) är tryckfallet ca 50% lägre.</Paragraph></Data></WebEditorDocument>
i tried to read the file
try
{
StringReader srXmlValue = new StringReader(param.ParamValue.Replace("<Break/>", Environment.NewLine));
XmlTextReader trXmlValue = new XmlTextReader(srXmlValue);
while (trXmlValue.Read())
{
switch (trXmlValue.NodeType)
{
case XmlNodeType.Element: // The node is an element.
if (trXmlValue.Name.Trim().ToLower() == "paragraph")
{
txtParamValue.Text += String.Format("[###Paragraph-{0}###]", trXmlValue["Format"]);
txtParamValue.Text += Environment.NewLine;
}
break;
case XmlNodeType.Text: //Display the text in each element.
txtParamValue.Text += Environment.NewLine;
txtParamValue.Text += trXmlValue.Value;
// txtParamValue.Text += Environment.NewLine;
// txtParamValue.Text += Environment.NewLine;
break;
}
}
}
catch
{
txtParamValue.Text = param.ParamValue;
}
but getting problem near <subscript>3</subscript>,
i have to show the entire text in paragraph tag in richtextbox
thanks