POV-Ray : Newsgroups : povray.off-topic : The trouble with XSLT Server Time
29 Jul 2024 14:15:58 EDT (-0400)
  The trouble with XSLT (Message 65 to 74 of 84)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Francois Labreque
Subject: Re: The trouble with XML
Date: 5 Mar 2012 08:25:45
Message: <4f54bed9$1@news.povray.org>
Le 2012-03-05 03:54, Invisible a écrit :
>>> That tells an XML processor what the character encoding is. It does not
>>> tell your text editor what the encoding is.
>>
>> How about rephrasing this: "It does not /necessarily/ tell your text
>> editor what the encoding is."
>>
>> What part of "get a decent text editor" didn't you understand? :-P
>
> Can you name one single text editor which can actually change character
> encoding based on a mere XML encoding specification?

I would bet emacs does it, since it does everything, including sorting 
laundry and fixing tires.

But seriously, though, http://www.lmgtfy.com/?q=xml+editors
-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   gmail.com     */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: The trouble with XML
Date: 5 Mar 2012 13:19:11
Message: <4f55039f$1@news.povray.org>
>>> What part of "get a decent text editor" didn't you understand? :-P
>>
>> Can you name one single text editor which can actually change character
>> encoding based on a mere XML encoding specification?
>
> I would bet emacs does it, since it does everything, including sorting
> laundry and fixing tires.

Yeah. But then I'd have to use Emacs...

> But seriously, though, http://www.lmgtfy.com/?q=xml+editors

Right. Because my text editor only needs to edit XML. Oh, wait...

In all seriousness though. I could probably just configure my editor to 
always use UTF-8. That still doesn't solve the problem of typing obscure 
characters in the first place. And it still doesn't change the fact that 
as soon as I open the file in any other program, it's going to break 
because that other program doesn't know what the hell character encoding 
to use.


Post a reply to this message

From: clipka
Subject: Re: The trouble with XML
Date: 5 Mar 2012 13:51:17
Message: <4f550b25$1@news.povray.org>
Am 05.03.2012 09:54, schrieb Invisible:
>>> That tells an XML processor what the character encoding is. It does not
>>> tell your text editor what the encoding is.
>>
>> How about rephrasing this: "It does not /necessarily/ tell your text
>> editor what the encoding is."
>>
>> What part of "get a decent text editor" didn't you understand? :-P
>
> Can you name one single text editor which can actually change character
> encoding based on a mere XML encoding specification?

The integrated text editors of both MS Visual Studio 2010 and 
BeyondCompare 3.0 definitely do it (and yes, I'm talking about plain 
"ASCII" text editors, not dedicated XML editor components).

As for stand-alone text editors, I've not used any for years, but I 
wouldn't be surprised if current versions of e.g. UltraEdit would be 
doing this as well (it does have some "auto-detect UTF-8 encoding" 
option after all, though I can't find any details about the magic used 
in there).


Post a reply to this message

From: clipka
Subject: Re: The trouble with XML
Date: 5 Mar 2012 14:10:57
Message: <4f550fc1$1@news.povray.org>
Am 05.03.2012 19:19, schrieb Orchid Win7 v1:
>>>> What part of "get a decent text editor" didn't you understand? :-P

> In all seriousness though. I could probably just configure my editor to
> always use UTF-8. That still doesn't solve the problem of typing obscure
> characters in the first place.

Did you know that good text editors allow you to define your own fancy 
keystroke combinations? So you can place your favorite special 
characters on some easily memorizable combo of Alt-Shift-Explode or 
whatever suits your needs.

> And it still doesn't change the fact that
> as soon as I open the file in any other program, it's going to break
> because that other program doesn't know what the hell character encoding
> to use.

That's plain stupid nonsense. A non-UTF-8-aware text editor (or any 
other piece of software capable of processing extended-ASCII text files) 
confronted with a UTF-8 text file will display apparently random stuff 
in place of any non-ASCII characters, but that random stuff saves fine, 
and parses back as later UTF-8 without problem. Just make sure you don't 
insert non-ASCII characters in the troublesome editor, and don't insert 
anything into that random stuff.

This property is one of the fun things about UTF-8: Anything that can 
handle at least /one/ extended-ASCII codepage can also handle UTF-8 
transparently without even knowing.

(You /will/ get into trouble though if your <?xml ...?> declaration 
doesn't match the actual character encoding of the file, but I guess 
that should be obvious.)


Post a reply to this message

From: Jim Henderson
Subject: Re: The trouble with XML
Date: 5 Mar 2012 16:01:59
Message: <4f5529c7$1@news.povray.org>
On Mon, 05 Mar 2012 20:10:56 +0100, clipka wrote:

> Alt-Shift-Explode

I need a keyboard that has that as an option on it. :)

Jim


Post a reply to this message

From: Darren New
Subject: Re: The trouble with XML
Date: 5 Mar 2012 22:13:44
Message: <4f5580e8$1@news.povray.org>
On 3/4/2012 18:05, clipka wrote:
> ... which is why there is XML Schema. And XML namespaces.

Actually, I'd be happy if once, once in my career, someone would provide me 
"an XML feed" that could actually be parsed by an XML library without first 
having to do a bunch of string crap to it to make it right.

-- 
Darren New, San Diego CA, USA (PST)
   People tell me I am the counter-example.


Post a reply to this message

From: Darren New
Subject: Re: The trouble with XML
Date: 5 Mar 2012 22:15:57
Message: <4f55816d$1@news.povray.org>
On 3/5/2012 0:54, Invisible wrote:
> Can you name one single text editor which can actually change character
> encoding based on a mere XML encoding specification?

I expect you could set up vim to do it, since you can set it up to recognize 
Python, Bash, etc.

-- 
Darren New, San Diego CA, USA (PST)
   People tell me I am the counter-example.


Post a reply to this message

From: Mike Raiford
Subject: Re: The trouble with XML
Date: 9 Mar 2012 15:50:01
Message: <web.4f5a6cccc07fe63964c6b3fb0@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> On 26/02/2012 12:35 AM, Darren New wrote:
> > On 2/25/2012 2:37, Orchid Win7 v1 wrote:
> >> For example, to say "this XML file actually contains XHTML", you're
> >> supposed
> >> to add something like 5 separate headers, each about 25 million miles
> >> long,
> >> to the top of the file. Why? Would one header not be sufficient?
> >
> > Really? What do you have to add? I suspect you exaggerate a bit.
>
> First, you must say
>
> <?xml version="1.0" encoding="ISO-8859-1" ?>

Gaah! No! Use UTF-8! 8859-1 is Western European/United States only! Any
characters that are not in this set will be rendered as ? or worse. UTF-8 gives
access to the whole of the Unicode codeset, so no data will be mangled by the
encoding. Sorry, I'm a big proponent of using a more universal character set,
especially when handling data.

>
> Which is fair enough, although the 5-digit ISO code number isn't exactly
> easy to remember. Then you have to say
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>
> Yeah, I'm really going to remember that without looking it up. :-P No,
> you can't just say "this is XHTML". You really do have to write all that
> crap. And after /that/, you still have to say
>

Yeah, the DTD is a bear; what you do is set up a starting point and use that so
you don't have to remember the DTD all the time.

> <html xmlns="http://www.w3.org/1999/xhtml">
>
> Um, didn't I just declare this as XHTML already? At least this URL is a
> bit shorter, I guess...
>

You set a doctype processing instruction that gives a web browser information on
how to handle your document, remember, HTML comes in many different flavors.
Your xhtml document is an xml document. The xmlns attrubute is specifying that
this document should conform to the specifications of the xhtml standard. I
think this is actually optional, but allows better validation. This uses an xsd
file which defines the schema.

> In short, that's a /hell/ of a lot of typing, before I've even written
> my document. It's also a lot of typing that I have to go look up on
> three different websites every single damned time I want to write XHTML.

Meh. You create a starter file and copy that when you want to do an xhtml file.

> >> Then there's all that stupidity with character entities. It should be
> >> possible to include character entities in /all/ XML documents, not just
> >> XHTML. But to this day, I have never discovered a way of doing this.
> >
> > You have to declare the entities. Otherwise, you run across &frump; and
> > don't know what it means. That's what DTDs are for.
>
> So why isn't there a DTD somewhere that contains all the entities that
> everybody uses, which I can just link to? More to the point, since
> everybody uses the same set of entities, why aren't they built in?
>

Because sgml is a standard that allows a large amount of flexibility in what it
actually is.

> >> One of the nice ideas of XML is that you can use namespaces to include
> >> one
> >> sort of XML document inside enought - e.g., you could put an SVG file
> >> inside
> >> an XHTML file. But nooo, apparently you need a specialised DTD to do
> >> that.
> >
> > You can. Of course, your various processors have to know what the
> > various namespaces *mean*, so you have to declare them and you have to
> > have a processor that understands them (which is where the DTDs come in).
>
> You would /think/ you could just say "hey, this stuff here is in the
> XHTML namespace, this stuff here is in the SVG namespace", and that
> would work. But it doesn't. You need to use a DTD specially written for
> the exact combination of XHTML+SVG. To me, this indicates that the
> system is fundamentally broken. It should not be necessary to write a
> separate DTD for every possible combination of XML documents imaginable.
> You should just be able to refer to the DTD for XHTML and the DTD for
> SVG and have it work.

Thing is, the DTD and schema can be defined anywhere. That's why all of the
clunky URL's.


Post a reply to this message

From: Mike Raiford
Subject: Re: The trouble with XSLT
Date: 9 Mar 2012 15:55:01
Message: <web.4f5a6d50f77903f464c6b3fb0@news.povray.org>
Le_Forgeron <lef### [at] freefr> wrote:
> Le 23/02/2012 10:11, Invisible a écrit :
> > This still leaves me with the problem of how to generate unusual
> > characters in the first place. Typing → is pretty simple. Figuring
> > out how to actually generate the arrow character is not.
>
> You just need the right documentation.
> Either you search it each time on the web (like "utf-8 chartable"... )
>
> or you call it correctly, and ask for unicode (utf-8 is one
> presentation, unicode is what you really want), and get to print the
> parts that you need often.
>
> See http://unicode.org/charts/
>
> And soon you will discover that there is no single font to display all
> possible unicode glyphs.
>
> You also need a unicode-compatible editor...

Code2000 comes close for Plane 1... The higher planes are a different story
alltogether, but most of those are rather specialized anyway.


Post a reply to this message

From: Warp
Subject: Re: The trouble with XML
Date: 9 Mar 2012 15:56:10
Message: <4f5a6e6a@news.povray.org>
Mike Raiford <no.### [at] spamme> wrote:
> > <?xml version="1.0" encoding="ISO-8859-1" ?>

> Gaah! No! Use UTF-8! 8859-1 is Western European/United States only! Any
> characters that are not in this set will be rendered as ? or worse. UTF-8 gives
> access to the whole of the Unicode codeset, so no data will be mangled by the
> encoding. Sorry, I'm a big proponent of using a more universal character set,
> especially when handling data.

  Nothing stops you from using &#xx; codes regardless of the encoding.

-- 
                                                          - Warp


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.