Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

What are the different styles that can be applied to xmlwriter. Please share.
I'm showing xmlwriter object in my report .

C#
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();


Thanks.

Regards,
Sajith
Posted
Updated 23-Jan-12 3:54am
v2
Comments
Sergey Alexandrovich Kryukov 23-Jan-12 12:34pm    
Styles? And what's the purpose if this code sample.
--SA

I appreciate your fantasy, but there is no such thing.

—SA
 
Share this answer
 
You tagged the question to C# 4.0.
Take a look at XElement class[^]
With XElement you can write the same code like this:
C#
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),


Or look at XmlWriterSettings Class[^]. There you can customize the writing behavior for the XmlWriter.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900