Results 1 to 28 of 28

Thread: Xml

  1. #1
    Matt.Net
    Guest

    Xml

    I've been reading about XML replacing INI in the future

    What i want to do is use XML with some datasets/dataadapters/sqlconnections.

    I want to store object properties like "datasource", "integrated security" etc for a server.

    I then want to use the stored data in my sqlconnection.

    I know i need to use a XMLReader in my code, but that's where i'm all freaked out cos it looks too complex for me.

    Could you post some code, or some commands which i would be using?

    Thanks
    Matt

  2. #2
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    no

    i think xml is a scam, i don't use tech that is shoved down my throat when i already had it

    in my humble opinion xml is just a bunch of extra work you don't need
    Magiaus

    If I helped give me some points.

  3. #3
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    well

    unless my boss tells me to
    Magiaus

    If I helped give me some points.

  4. #4
    Matt.Net
    Guest
    well, lets say your boss is telling you too.

    cos mine is kinda pushing me towards this...

  5. #5
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    ok

    what do you know? do you know XML 1.0 yet? or are you starting from scratch?

    unfortantly M$ is going to make us all use XML I have even read about it replacing relational database like SQL Server. Why? because M$ said so. stupid flat file bs.....
    Magiaus

    If I helped give me some points.

  6. #6
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    no not stupid flat file...STRUCTURED flat file..that is what it is all about.

    I think you are on the thinking of XML is a replacement for the database..it is not. It provides a structured way to describe data...something that was laking, especially for cross platform use.

    XML is great, when you use it for the right things.

    i havent used the xml classes in .NET yet, but you can probably find plenty of examples at

    http://www.gotdotnet.com
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  7. #7
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    i know it structered

    I have read 2 books on XML and a book on flash and xml. I know it is structured an i also see uses for it. But I had that 3 years ago i just didn't call it XML. Also as far as XML and the web go that is crap. I have these things called style sheets that i use and well the work without XML (or could be considered a form of xml) but i read articles that tell me i need to use xml with style sheets and that is bs. xml is good for keeping up or documetation so to speak but it is just another layer of work. it is good for property files and the like but anything else it is just ading work to your plate. and maybe i'm wrong but it isn't worth it. instead of a style sheet and a page i now have a xml do a style sheet and the page you do the math my results as far as content look the same.

    i am not at all closed minded so please, please make me like XML cause i am going to have to use it
    Magiaus

    If I helped give me some points.

  8. #8
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    oh

    and people writing code book are saying xml is going to replace sql
    Magiaus

    If I helped give me some points.

  9. #9
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    well css is just for styling a page..not conaprable to XML which is useful to seperate content and data on your web page.. Also XML has a something that goes with it called XSL. This allows you to transform you XML into HTML/another XML format/SVG/whatever...that in itself is a handy tool to make a more dynamic webpage in which the client can do the work saving your server some processing(for instance, your server can create the xml, but the client turns it into html by using XSL.)

    Another excellent use for XML as I use it..I have a web based system I wrote that is very traffic intense..Each person has alot of info that needs to be persisted while they are logged on. But the content hitting to a database as they edit data can be a tremendous strain. So what I do is, when a use logs on, their data is all palced into an xml string and placed in a session variable. As they go through the site, any cahnges are made to the XML string very easily..When they log off, then any changes made are sved to the database..

    And as far as XML vs. a flat file. Well XML is easy to read and easier to access what you want. I mean how many times have you had to get data from a plain text file by opening it, looping it to find the correct line, then have to parse the hell out of the file to get what you want? In many cases, this is a pain in the butt to write bunches of instr$'s and mid$'s. In xml you just specify the node, all voila you got what you need.

    XML is also usefule to transfer data bvetween databases that normally cannot talk to each other..although i have never needed this working in an all MS shop, and you may never need it either, but I have talked to many people who have said this is a god sent for getting Unix data to Windows and vice versa..
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  10. #10
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    question

    what do you think the XMLParser does for you it pareses the file. or splits it based on the file header

    I don't know much about XSL though it isn't covered in the books i have in fact i think i just got bunk books because they don't teach anything about how to use xml just how to make xml except for the flash book it teaches how to use xml with flash.....
    Magiaus

    If I helped give me some points.

  11. #11
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    ok

    lets not argue about why or why not it is good or redundant lets help matt instead
    Magiaus

    If I helped give me some points.

  12. #12
    Lively Member MedevH's Avatar
    Join Date
    Aug 2001
    Location
    Where I walk, I walk alone. Where I code, I code alone.
    Posts
    91

    Hey Now

    Now this is a bit unusual
    this whole discussion about XML
    I've played with XML usage in flash and just though it was to many tags to deal with.

    Why in the world would I want to define text in a <text></text> tag oh well.

    I like what cander is saying about the Cross-DB exchange I'm betting there are lots of programmers that find that useful.

    I still do not see the replacing of the Relational Database happening. It just doesn't make any sense.

    Structured Flat File or Stupid Flat File.

    Its still a flat file,
    I see XML just like coding in COBOL.
    You the programmer have to lay everything out.

    I'm not a programmer I'll be the first to say it.
    I'm a developer, I don't like typing.
    Thats just to much to have to write especially when a database does all that for you.
    There is no good or evil only CODE! ~MedevH~

  13. #13
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    ok now you've done it

    you made me get out my XML book and actualy want to start reading again. But I looked in the index and XSL is barely covered..... and that sounds like the good part. i'm on chapter 13: Creating a Basic XML Document. page 184 and now i finally get to make a document...... recomended reading..?
    Magiaus

    If I helped give me some points.

  14. #14
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    medevh

    00010 IDENTIFICATION DIVISION.
    00020 PROGRAM-ID. FIK_DICH.
    00030 AUTHOR. Magiaus.
    00040 *
    00050 ENVIORMENT DIVISION.
    00060 *
    00070 DATA DIVISION.
    00080 *
    00090 PROCEDURE DIVISION.
    00100 DO-IT.
    00110 DISPLAY "Fik Dich Mein Houndien."
    00120 STOP RUN
    Magiaus

    If I helped give me some points.

  15. #15
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    the point I was making about the parsing is that YOU, the developer, doesnt have to do the parsing.

    BTW who is arguing, just trying to explain XML as far as usefulness and practicallity..not just theory..

    if you want to get some quick down and dirty info on XSL, you should goto

    http://www.xml101.com

    they have some good quick startting info on using XSL to transform XML into html..


    Another coolness factor of XML and XSL that many people dont know about, is you can use XSL to turn an XML document into SVG. SVG is an xml based language that lets you do pretty much what flash does. It is pretty cool to be able to create dynamic images and animation using this.

    Ok as far as helping him out, I gave alink to soemwhere with soem tutorials as I just havent used XML in .NET as of yet, so I havent studied that class.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  16. #16
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    ok cander

    Magiaus

    If I helped give me some points.

  17. #17
    Lively Member MedevH's Avatar
    Join Date
    Aug 2001
    Location
    Where I walk, I walk alone. Where I code, I code alone.
    Posts
    91

    This is just a question

    Cander...How much XML do you use on a daily basis?
    And do you have any other resources on it other than the link provided?

    You've got me interested in it again too.

    Oh one other question,
    just thought I'd ask Do you have anything on XML inside of FLASH

    I've looked and most of the time they talk about the Basics,
    Well I have a concept of the basics.
    There is no good or evil only CODE! ~MedevH~

  18. #18
    Matt.Net
    Guest
    yes, do help me.

    i think using XML to store properties is what i'm hoping to do.

    As for my experinece in XML, i basically only know how to make the XML files. That's it.

    Basically, i'm 19, have a limited knowledge of VB from high school, and have been thrust into the VS.Net fold.

    Matt

  19. #19
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    ok Matt

    I have to do a little research on using it in .net but i will post something
    Magiaus

    If I helped give me some points.

  20. #20
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    From my personal experience, I think XMl and XSL rock. On the project that I am working on (and past projects), we don't use private variables in our business objects to store our data, rather, we use a XML document. Our property let and gets just read/write directly against the xml doc. We've even used the MSXML parser to transform our setup install into Base64 and stream it across the intranet. The possibilities are endless. XML will be huge for a long time..

  21. #21
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    ok matt

    here is some reading

    The XmlReader class is an abstract base class that provides non-cached, forward-only, read-only access. The XmlReader class checks that the XML is well-formed, and throws XmlExceptions if an error is encountered. It can read a stream or a document, and it implements the namespace requirements outlined in the recommendation provided by the W3C located at www.w3.org/TR/REC-xml-names.

    Being an abstract base class enables you to customize your own type of reader or extend the current implementations of XmlTextReader, XmlValidatingReader, and XmlNodeReader classes.

    The XmlReader class also defines methods that enable you to pull data from XML or to skip unwanted records. XmlReader is unlike the SAX model, which is a push model with the parser pushing events to the application. For more information on a comparison to SAX, see Comparing XmlReader to SAX Model.

    The XmlReader class has methods to:

    Read XML content when the content is available in its entirety, for example, an XML text file.
    Find the depth of the XML element stack.
    Determine if an element has content or is empty.
    Read and navigate attributes.
    Skip over elements and their content.
    The XmlReader class has properties that return information, such as:

    The name of the current node.
    The content of the current node.
    Implementations of the XmlReader class extend the base class and vary in their design to support different scenario needs. The following table describes the implementations of the XmlReader class.

    Class Description
    XmlTextReader Class Reads character streams. It is a forward-only reader that has methods that return data on content and node types. There is no Document Type Definition (DTD) or schema support.
    XmlNodeReader Class Provides a parser over an XML Document Object Model (DOM) API, like the XmlNode tree. Takes in an XmlNode, it returns whatever nodes it finds in the DOM tree, including entity reference nodes. There is no DTD or schema validation support but it can resolve entities defined in DTD.
    XmlValidatingReader Class Provides a fully compliant validating or non-validating XML parser with DTD, XML Schema definition language (XSD) schema or XML-Data Reduced (XDR) schema support. Takes an XmlTextReader and layers validation services on top.
    Customized XML Reader Creation Allows developer-defined derivations of the XmlReader.

    The XsltReader is another implementation that does not have a public constructor. It is created as a result of calling the Transform method on the XslTransform class. The XsltReader provides the following functionality:

    Enforces the rules that XML must be well-formed.
    Does not validate against DTDs or schemas.
    Does not expand default attributes, because DTD information (DOCTYPE nodes) are not exposed in the XPath Data Model. See the XmlReader.IsDefault property. If you need to expand default attributes in the source document before applying a transformation, then the data store (for example, XmlDocument) needs to be loaded through an XmlValidatingReader.
    Each of the classes, XmlTextReader, XmlValidatingReader, and XmlNodeReader, are designed to support different scenarios. The table below describes which reader to use for each scenario, and what value to give the ValidationType property.

    Scenario Reader to use ValidationType property
    Needs greater performance and does not need any DTD or Schema support. XmlTextReader Not available.
    Requires the XML to be well-formed, including external entities and DocTypes with a supplied DTD. XmlTextReader Not available.
    Needs XML to be valid and well-formed according to the DTD. XmlValidatingReader Auto or DTD.
    Needs XML to be well-formed and validated against a schema. XmlValidatingReader Auto when no DTD is available, or XDR schema.
    Needs XML to be well-formed when streaming XML data from an XmlNode. XmlNodeReader Not available.

    The following table describes how the XmlResolver and XmlTextReader.Normalization properties on the various readers can be set to achieve each scenario.

    The Normalization property, when set to true, removes white space in attribute values and does character range checking. As a result, setting the Normalization property to true results in slower performance than when it is set to false, which is the default value. For more information, see XmlTextReader.Normalization Property.

    Scenario XmlResolver Normalization property
    Needs greater performance and does not need any DTD or Schema support. Set to null reference. For more information, see XmlTextReader.XmlResolver Property. Set to false.
    Requires document to be well-formed, including external entities and DocTypes with a supplied DTD. Set to non-null reference. All external entities must be resolvable. For more information, see XmlTextReader.XmlResolver Property. Set to true.
    Needs document to be well-formed, and needs the XML to be valid according to the DTD. Set to non-null reference. All external entities must be resolvable. For more information, see XmlValidatingReader.XmlResolver Property. Set to true on XmlTextReader before being passed to XmlValidatingReader.
    Needs document to be well-formed and needs schema validation. Set to non-null reference. All external entities must be resolvable. For more information, see XmlValidatingReader.XmlResolver Property. Set to true on XmlTextReader before being passed to XmlValidatingReader.
    Needs document to be well-formed when streaming XML data from an XmlNode. Not available. Not available.

    The XmlResolver property is used for resolving external DTD and schema location references. The XmlResolver is also used to handle any import or include elements found in XSD schemas. Setting the XmlResolver property to null means that the application does not resolve external references. If this property is set to null and an external DTD or entity is encountered, the external DTD or entity is ignored.
    Magiaus

    If I helped give me some points.

  22. #22
    Matt.Net
    Guest
    and in English...?

    Just kidding, thanks for that. it'll take a while for me to comprehend all of that.

    So basically, i would use the XMLReader to return the name of the node, and if that matches with whatever i want, then i can use another method to return the properties i have stored?

    Matt

  23. #23
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    haven't tried it

    i was going to but i got distracted by some stuff on the general board, but i think that is the idea
    Last edited by Magiaus; Apr 16th, 2002 at 12:02 AM.
    Magiaus

    If I helped give me some points.

  24. #24
    Matt.Net
    Guest
    so to return the properties, it would be something like :
    where node = [servername]..?

    i'm a little more confident now to give it a go...

    its funny how your attitude to XML has changed

  25. #25
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    well

    at first i was just being funny because i don't like it much and didn't know what cander informed us about so yeah it changed some

    i am about to try and make a small xml app so i'll post something soon
    Magiaus

    If I helped give me some points.

  26. #26
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    hey lets setup the doc

    Code:
    <?xml version = "1.0"?>
    <!ELEMENT blankProps [
    <!Element propArrayOne (info, moreDetail,evenMore)>
    ]>
    i am going to have to do a little rereading i have forgotten a bunch of this but lets make a doc and see what we can do
    Magiaus

    If I helped give me some points.

  27. #27
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    hey matt

    sorry but i'm not going to be able to do anything on this xml help for a day or two

    maybe someone else will help out

    i will post in a day or two though
    Magiaus

    If I helped give me some points.

  28. #28
    Matt.Net
    Guest
    don't worry.

    i'm now working on something a little more important.

    i'll be back for help in about a week or two

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width