是否可以像 XML 一样将自己的标签添加到 GPX 文件中?
我知道 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
所有 gpx 类型,包括
< /a> 本身有一个叫做
的东西。扩展可以保存您想要的任何 xml 内容。唯一的要求是您放入其中的内容链接到不同的模式。因此,需要为标签使用命名空间。假设您在顶部定义了 myns 命名空间,您可以在其中放置类似
Sometownhere
的内容。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.