是否可以像 XML 一样将自己的标签添加到 GPX 文件中?

发布于 2025-01-03 20:26:27 字数 129 浏览 4 评论 0原文

我知道 GPX 是一种轻量级 XML 数据格式,但我想知道是否可以添加我自己的标签,例如 这里的某个城镇 将保存 GPS 数据附近最近的城镇,或者我是否必须将其保存在单独的 XML 文件中?

I know GPX is a light-weight XML data format but what I want to know is it possible to add my own tag like <Town> Some Town here </Town> which will hold the nearest town that the GPS data was done near or would I have to save this in a seperate XML file?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧夏天 2025-01-10 20:26:27

所有 gpx 类型,包括 < /a> 本身有一个叫做 的东西。扩展可以保存您想要的任何 xml 内容。唯一的要求是您放入其中的内容链接到不同的模式。因此,需要为标签使用命名空间。

假设您在顶部定义了 myns 命名空间,您可以在其中放置类似 Sometownhere 的内容。

  • 您可以在此处的 Gpx 规范中了解更多相关信息
  • 。Garmin 广泛使用扩展程序。要了解他们是如何做到这一点的,您可以此处获取他们的架构

All the gpx types, including <gpx/> itself, have have something called <extensions/>. Extensions can hold any xml content you want. The only requirement is that what you put in there is linked to a different schema. Therefor it's required to use a namespace for your tags.

You can put something like <myns:town>Some town here</myns:town> in there assuming you define the myns namespace in the top.

  • You can read more about this in the Gpx specs here
  • Garmin uses extensions extensively. To get an idea how they do it you can get their schema here
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文