XmlWriter中的不同样式 [英] Different Styles in XmlWriter
本文介绍了XmlWriter中的不同样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可以将什么样式应用于xmlwriter
.请分享.
我在报表中显示xmlwriter
对象.
Hi,
What are the different styles that can be applied to xmlwriter
. Please share.
I''m showing xmlwriter
object in my report .
xmlWriter.WriteStartElement("Glyphs");
xmlWriter.WriteAttributeString("Fill","#ff000000");
xmlWriter.WriteAttributeString(
"FontUri",xpsFonts[0].Uri.ToString());
xmlWriter.WriteAttributeString("FontRenderingEmSize","18");
xmlWriter.WriteAttributeString("OriginX","120");
xmlWriter.WriteAttributeString("OriginY","110");
xmlWriter.WriteAttributeString("UnicodeString",documentUri);
xmlWriter.WriteEndElement();
谢谢.
问候,
Sajith
Thanks.
Regards,
Sajith
推荐答案
我很感谢您的幻想,但没有这样的事情.
—SA
I appreciate your fantasy, but there is no such thing.
—SA
您已将问题标记为C#4.0.
看看 XElement类 [
You tagged the question to C# 4.0.
Take a look at XElement class[^]
With XElement you can write the same code like this:
var x = new XElement("Glyphs",
new XAttribute("Fill", "#ff000000"),
new XAttribute("FontUri", xpsFonts[0].Uri.ToString()),
new XAttribute("FontRenderingEmSize", "18"),
new XAttribute("OriginX", "120"),
new XAttribute("OriginY", "110"),
new XAttribute("UnicodeString", documentUri),
或查看 XmlWriterSettings类 [
Or look at XmlWriterSettings Class[^]. There you can customize the writing behavior for the XmlWriter.
这篇关于XmlWriter中的不同样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文