Click here to Skip to main content
11,481,265 members (64,865 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
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();

Thanks.

Regards,
Sajith
Posted 16-Jan-12 1:39am
sajithnet1.2K
Edited 23-Jan-12 4:54am
Ravi Sant21.7K
v2
Comments
SAKryukov at 23-Jan-12 12:34pm
   
Styles? And what's the purpose if this code sample.
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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

—SA
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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),

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

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 294
1 OriginalGriff 220
2 CPallini 135
3 CHill60 130
4 Richard MacCutchan 80
0 Sergey Alexandrovich Kryukov 8,184
1 OriginalGriff 7,701
2 Sascha Lefèvre 3,114
3 Maciej Los 2,491
4 Richard Deeming 2,335


Advertise | Privacy | Mobile
Web02 | 2.8.150520.1 | Last Updated 23 Jan 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100