Alex Birch on 28 Nov 2003 10:45:03 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] XML, text, and the development of unix


gabriel rosenkoetter wrote:

On Tue, Nov 25, 2003 at 09:20:47AM -0500, Alex Birch wrote:

Please show me an example where seeing in XML where there is a difference between a tab or a space?


I was generalizing the mistake. You made a syntax error, make(1)
barfed on it. There is *more* syntax to know in XML and, thus, more
potential for mistakes.

What's the more syntax to know with XML? I'd say there are more semantics but the syntax seems pretty straight forward to me.


I don't see the "copying from a book" case as particularly relevant.
First, the book's author, if he's teaching Makefile syntax, is
responsible for pointing out that rule definitions need to be
prefaced with a tab.

I was in a hurry to create a makefile. That was my first nontrivial linux program. I just wanted to create a makefile that worked quickly and I learn best by initially copying and changing. After more experience I can build from scratch, but usually not the first couple of times.


> Second, I find it hard to believe that you
> consult a book on every XML tag that you type.

Is this a fair analogy? Wouldn't it be more appropriate to ask if I consulted a book or online documentation the first time I created an Ant file? The answer is yes, I did. Prescient and omniscient are not two of my attributes.

I trust you have the same complaint against Python?

No because Python as long as you're consistent it's all good. When I was in Berkeley we just used two spaces, but you could use two tabs.



With XML at least I can SEE the difference.


That is true, in this specific case.

That was my entire point, regarding the readability of ant versus makefile.



What I was thinking is just a thin wrapper and know when you're inside a tag. Then just return the tag.


I'm not sure I understand what you mean here. Could you give an
example of input and output?

file.xml ... <foo att1="val1" att2="val2"> grepValue </foo> <foo att1="val1" att2="val2"> another value </foo>

Then if I did xgrep -i "grepvalue" file.xml

It would produce:
<foo att1="val1" att2="val2">
grepValue
</foo>

the wrapper would realize that grepValue was inside of the <foo></foo> tags.


What other traditional tools would be nice? xsed? xgrep?


Weren't we discussing xgrep? (Did you mean xawk?)

I was thinking of all the possible friends of xgrep and other line oriented text manipulation files.


I think sed and awk's functionality doesn't necessarily map cleanly
onto XML. When I use xawk, do I want the whole tag, do I want the
contents of the tag, what?

Why not have both? have special fields map to the values? $v1, $v2 while the $0 maps to the entire tag. This could allow people to quickly get the tag and value that they want.



When I use xsed, do I want only to
replace tag names? Do I want to replace tag values? There're some
serious interface questions that would need to be considered to
adhere to the principle of least surprise.

That's why I'm trying to get feedback before I start a project like this. If I hope to see as far as others, I must stand on the backs of giants.


___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug