Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

Dustin Metzgar

@Dustin Metzgar
About
Posts
563
Topics
8
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Why does Windows XP think that nobody else has ever heard of Ctrl-Alt-Del?
    D Dustin Metzgar

    Thanks! I googled "GINA driver" and got nothing. So this is pre-Vista only. Somehow I think Microsoft would be aware that this is a security threat. I hadn't heard of this being used in a virus. But you probably have some experience with it.

    The Lounge question security help

  • Why does Windows XP think that nobody else has ever heard of Ctrl-Alt-Del?
    D Dustin Metzgar

    What's a GINA driver?

    The Lounge question security help

  • food for thought
    D Dustin Metzgar

    Ditto on that! Best part of Rochester.

    “Ooh... A lesson in not changing history from Mr. I'm-my-own-grandpa” - Prof. Farnsworth

    The Lounge com

  • After Vista
    D Dustin Metzgar

    Maybe if they fixed it in the next version, I'd be fine. But SharePoint development is still done on an HTML stream and people have been complaining about the collapse all projects since the first Visual Studio .Net.

    Logifusion[^]

    The Lounge com

  • XML
    D Dustin Metzgar

    System.Xml.XmlDocument[^]

    Logifusion[^]

    C# xml csharp wcf

  • After Vista
    D Dustin Metzgar

    Not to be mean or anything, but I've been hit with new Microsoft technologies repeatedly all year and I'm a little jaded. All the new .Net 3 stuff, the Vista APIs like power management and system recovery, the new MOSS, the OpenXML format, Expression, Orcas, Linq, ... It's exciting stuff. But it would be nice if Microsoft would fix the problems they have now for a change. Like why is VS2005 so friggin slow and memory heavy? Why is Windows Media Player 11 unable to play videos smoothly on my laptop while 10 could do it no problem? Why do you have to forgo the nice WYSIWYG user controls designer in order to make SharePoint web parts that really use SharePoint? And, for the love of dog, why has no one put a button in VS that allows you to collapse all the projects in your source tree?

    Logifusion[^]

    The Lounge com

  • XML Fragment Serialization [modified]
    D Dustin Metzgar

    I finally got to a dev environment where I could test it. There really isn't a way to wipe those attributes off of there, which I think is a very frustrating part of using XmlSerializer. Some of the tactics I've taken in the past are to implement IXmlSerializable (which isn't fun because you have to read and write from the xml stream yourself) or to load the serialized xml into an XmlDocument and remove the namespaces manually. I'm not sure if MVPXML[^] has done anything to handle this but you may want to check it out.

    Logifusion[^]

    C# xml json help question

  • Regex Question: How to search for "$"...
    D Dustin Metzgar

    Nitron wrote:

    match a literal "$" as it's not a valid escape character...

    As the other responses suggest, you should be able to escape the $. An alternative is to put it like this: [$]  instead of escaping it.

    Logifusion[^]

    C# regex tutorial question

  • XML Fragment Serialization [modified]
    D Dustin Metzgar

    That one's a bit tougher. Are you using namespaces in the attributes on the type?

    Logifusion[^]

    C# xml json help question

  • excel in C#
    D Dustin Metzgar

    You'll want to look into the Office PIAs[^] to do that.  The documentation that comes with it should help.

    Logifusion[^]

    C# csharp tutorial question

  • XML Fragment Serialization [modified]
    D Dustin Metzgar

    When you write from the XmlSerializer, you can use an XmlWriter (as a TextWriter). Use the static Create method off of XmlWriter to make a writer that has XmlWriterSettings. Using the settings, you can tell it to not put the declarations.

    C# xml json help question

  • Garbage collection problem
    D Dustin Metzgar

    You can force garbage collection by calling GC.Collect(), but if the most your application is taking in memory is 44k, I'm not seeing the problem.

    C# help database oracle performance tutorial

  • XML to HTML page
    D Dustin Metzgar

    Excellent, that helps a lot. You have to divide the XML from the XSL.  Here's what the XML should look like:

    <?xml version="1.0" encoding="utf-8"?>
    <greeting>Hello world.</greeting>

    And here's an example XSL:

    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
        <html>
        <body>
          <xsl:value-of select="greeting"/>
        </body>
        </html>
    </xsl:template>
    </xsl:stylesheet>

    You had the XSL tags in the XML source document.  The XML source document should be free-form, meaning that it can be pretty much anything as long as it's legal XML.  The XSL is the transform and is pretty specific to the input and output expected.  Check out zvon[^] or w3schools[^] for some tutorials on XSL.


    Logifusion[^]

    XML / XSL xml html performance

  • XML Xpath Xquery
    D Dustin Metzgar

    In this case, XSL is a little weak. There is a distinct-values[^] function in XPath 2. Microsoft doesn't like XPath 2 and has decided not to support it. You can use another parser like XmlSpy and it will work fine.  If you're using an XSLT, you can do a sort on a for-each so you could get all the like author names together, but that's about it.

    XML / XSL database xml tutorial learning

  • XML to HTML page
    D Dustin Metzgar

    You have to change your <'s to <'s and >'s to >'s. We can't see your XML text.

    XML / XSL xml html performance

  • To write file to other system on LAN
    D Dustin Metzgar

    Well, you should be able to write to a UNC path, but it would have a lot to do with permissions. Your application may be running under a different identity or a lower trust level than is required. For instance, I can successfully run this code on my network:

    static void Main(string[] args) {
    FileInfo fi = new FileInfo(@"\\othermachine\C$\IAmATest.txt");
    using (StreamWriter sw = new StreamWriter(fi.OpenWrite())) {
    sw.WriteLine("Hello World!");
    }
    fi.Delete();
    }

    There's nothing special required to write to this particular path. I have this inside a command line app and I'm running on a domain account, so I know that I have access to write to that path. If you're running under an NT service or IIS, you may want to impersonate a different user account.


    Logifusion[^]

    C# question

  • VB.NET | XML Namespace parsing issues
    D Dustin Metzgar

    Well, first I gotta ask if there's a typo in your input XML. The end tag for the document element doesn't match. The next thing I'd like to know is what is the error you're getting? Do you get the error when you load the document, when you put it in the data document, or when you run the transform?

    XML / XSL xml csharp asp-net com

  • Array.getLength() vs Array.getUpperBound()
    D Dustin Metzgar

    Yes, GetUpperBound is used to get the boundaries of different dimensions of an array. Call GetUpperBound(0) to get the upper bound of the first dimension, GetUpperBound(1) for the second dimension and so on. It's in case you're using a 2-dimensional (or higher) array. Also, GetUpperBound returns the highest index of that array instead of the number of values in that array. So, whereas you would do for (int i = 0; i < arr.Length; i++) for length, you would do this for the upper bound: for (int i = 0; i <= arr.GetUpperBound(0); i++)

    C# visual-studio data-structures question

  • Windows Service Questions
    D Dustin Metzgar

    MartyExodus wrote:

    I have my Windows Forms app and a Windows service compiled into the same EXE

    Why? It's not that hard to separate them into different projects.

    MartyExodus wrote:

    If anyone knows of any easier way to run a couple of DOS commands on a large group of remote computers

    You will definitely have to have an NT service on each computer.  And you should definitely have to install the service on each computer by script.  The script's not that hard, just installutil.  But you say DOS commands almost like you're using System.Diagnostics.Process[^] to run stuff from the command prompt.  In that case, why not just write a quick VBScript and run it on each computer?


    Logifusion[^]

    C# csharp winforms sysadmin tools performance

  • XSL general question
    D Dustin Metzgar

    picazo wrote:

    <xsl:template match="@* | node()">
    xsl:copy
    <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
    </xsl:template>

    This code is really your problem. You should try matching differently. Instead of doing this, try replacing it with:

    <xsl:template match="/">
    <TemplateRoot>
    <xsl:for-each select="InputRoot/elem">
    <xsl:apply-templates select="."/>
    </xsl:for-each>
    </TemplateRoot>
    </xsl:template>

    The code may not be exactly correct because I was too lazy to test it. I think it's a neat idea to mix two XML files, but it depends on your requirements. In most cases, you would want to adjust the XSL instead of having a template XML file outside, like led mike suggested.

    XML / XSL xml help question lounge
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups