Professional Web Applications Themes

API to generate _readable_ (with whitespace) XML? - Mac Programming

Hi, (In the Safari Bookmarks Sorter I'm working on) - When I write a sorted CFTree to a file using CFXMLTreeCreateXMLData and then CFURLWriteDataAndPropertiesToResource, the generated XML has no whitespaces - it's just one long line. The Mac doesn't mind, but people like me find this hard to read. These two "CF" functions do not seem to have any option to "generate readable XML with whitespace", and I can't find any API that does. Does anyone know where I should be looking? Certainly Apple must have thought of this! Jerry P.S. When I read in the XML file of bookmarks ...

  1. #1

    Default API to generate _readable_ (with whitespace) XML?

    Hi,

    (In the Safari Bookmarks Sorter I'm working on) -

    When I write a sorted CFTree to a file using CFXMLTreeCreateXMLData and then
    CFURLWriteDataAndPropertiesToResource, the generated XML has no whitespaces
    - it's just one long line. The Mac doesn't mind, but people like me find
    this hard to read.

    These two "CF" functions do not seem to have any option to "generate
    readable XML with whitespace", and I can't find any API that does. Does
    anyone know where I should be looking? Certainly Apple must have thought of
    this!

    Jerry

    P.S. When I read in the XML file of bookmarks using
    CFXMLTreeCreateFromData, I use an option to "skip whitespace". So, another
    way to solve the problem might be to not use this option, but this causes
    other problems (bus error when run without debugger, does not fix problem
    when run with debugger, ...).

    Jerry Guest

  2. #2

    Default Re: API to generate _readable_ (with whitespace) XML?

    >These two "CF" functions do not seem to have any option to "generate 

    My XMLIO XML pr/writer does: http://www.fxtech.com/xmlio


    Paul Guest

  3. #3

    Default Re: API to generate _readable_ (with whitespace) XML?

    in article com, Paul Miller at
    com wrote on 03/12/12 16:06:
     
    >
    > My XMLIO XML pr/writer does: http://www.fxtech.com/xmlio
    >[/ref]
    Yes, I have downloaded it now, and indeed it does look like a nice piece of
    work. Unfortunately, my XML data is an Apple CFXMLTree, which thus far I
    have not had to "climb into" very much. I was hoping that, with the right
    API, I could solve this with about 3 lines of code.

    Jerry

    Jerry Guest

  4. #4

    Default Re: API to generate _readable_ (with whitespace) XML?

    >> My XMLIO XML pr/writer does: http://www.fxtech.com/xmlio 
    >Yes, I have downloaded it now, and indeed it does look like a nice piece of
    >work. Unfortunately, my XML data is an Apple CFXMLTree, which thus far I
    >have not had to "climb into" very much. I was hoping that, with the right
    >API, I could solve this with about 3 lines of code.[/ref]

    Ah - that makes sense.

    Question - why not just use an XML-enabled editor (or maybe even the Apple
    XML property editor) to read your XML data? Since it is just a matter of
    formatting, this could easily be fixed in the editing tool, rather than in
    your XML generator.


    Paul Guest

Similar Threads

  1. Whitespace management
    By mate in forum Coldfusion - Advanced Techniques
    Replies: 2
    Last Post: August 11th, 04:33 PM
  2. CFC getter and whitespace
    By BSterner in forum Coldfusion - Advanced Techniques
    Replies: 2
    Last Post: July 16th, 12:52 AM
  3. Whitespace Problems
    By JakeFlynn in forum Macromedia ColdFusion
    Replies: 3
    Last Post: June 22nd, 09:52 PM
  4. cannot get rid of whitespace
    By AkronNick in forum Macromedia ColdFusion
    Replies: 10
    Last Post: April 11th, 06:25 PM
  5. get rid of whitespace around pipes??
    By Jeff 'Japhy' Pinyan in forum PERL Beginners
    Replies: 3
    Last Post: December 17th, 04:26 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139