all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuri Khan <yuri.v.khan@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: look@strawberrytea.xyz, emacs-devel@gnu.org
Subject: Re: [PATCH] ffap.el: Exclude angle brackets from file names in XML
Date: Sun, 10 Mar 2024 17:30:50 +0700	[thread overview]
Message-ID: <CAP_d_8VcxqOJHd+_YPKcZpTwfb+x10=3uqN7E_dD5irP8=GhRA@mail.gmail.com> (raw)
In-Reply-To: <86cys2wmmr.fsf@gnu.org>

On Sun, 10 Mar 2024 at 14:51, Eli Zaretskii <eliz@gnu.org> wrote:

> > Tags do not inherently mean anything in XML. Only a specific XML-based
> > format definition gives them meaning, and there is no way for either a
> > doctype definition or an XML Schema to say “elements named X
> > definitely contain file names”. The closest is XML Schema’s anyURI
> > datatype, but it might refer not necessarily to a local file but
> > possibly to any other URI-addressed resource.
>
> Are you saying that applications using XML hard-code the meaning of
> each tag that they need to process?  IOW, how does a program using
> such an XML know that the value is a file name?

XML is a generic framework for designing formats. Each application
designs a specific schema that defines which tags mean what.

For example, XHTML is an XML subtype in which the <img> element can
have a src="…" attribute which contains an URI. In particular, it
might contain a file name.

For another example, SVG is an XML subtype that does not define an
<img> element; <img> is invalid if used in an SVG document. On the
other hand, SVG has an <image> element whose href="…" attribute
contains an URI.


A program typically does not work with arbitrary XML. It works with a
specific XML subtype, like OpenOffice with ODF (which is a ZIP archive
containing, among others, some XML files) and Inkscape with SVG. In
case an application is capable of understanding multiple XML-based
formats, it must know beforehand which particular format a document is
an instance of.

For example, when Firefox receives an HTTP response with a
‘Content-Type: application/xhtml+xml’ header, it interprets the
response body as XHTML page; but with a ‘Content-Type: image/svg+xml’,
it processes the body as an SVG image.


(I did not expect you’d need a lecture on this.)



  reply	other threads:[~2024-03-10 10:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-09 21:37 [PATCH] ffap.el: Exclude angle brackets from file names in XML StrawberryTea
2024-03-10  5:48 ` Eli Zaretskii
2024-03-10  6:04   ` LemonBreezes
2024-03-10  6:40     ` Eli Zaretskii
2024-03-10  7:20       ` Yuri Khan
2024-03-10  7:51         ` Eli Zaretskii
2024-03-10 10:30           ` Yuri Khan [this message]
2024-03-10 10:46             ` Eli Zaretskii
2024-03-10 12:17               ` Yuri Khan
2024-03-10 12:43                 ` Eli Zaretskii
2024-03-10 13:15                   ` Yuri Khan
2024-03-10 13:53                     ` Lynn Winebarger
2024-03-14  9:49 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP_d_8VcxqOJHd+_YPKcZpTwfb+x10=3uqN7E_dD5irP8=GhRA@mail.gmail.com' \
    --to=yuri.v.khan@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=look@strawberrytea.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.