使用 XSLT 在 xml 中对 uuid 进行排序的问题 [英] Issues with sorting uuids in xml with XSLT

查看:32
本文介绍了使用 XSLT 在 xml 中对 uuid 进行排序的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我需要解析的 .xml 文件的一部分

解决方案

  1. 它删除了 'standalone="yes"?'第一行的一部分

standalone=yes" 添加到 xsl:output

<块引用>

  1. 删除元素中的值 '[CDATA['

声明命名空间 http://www.test.com/ae/types/2009 然后使用cdata-section-elements=ae:value"xsl:output 元素上.

<块引用>

  1. 它将process_model_port"元素组合在一行中,并在其末尾添加我在源文件中没有看到的版本.

您指的是 schemaVersion="007.000.004" 吗?因为那是在源 XML 中.至于元素是如何序列化的,以及它是否是一行,这不应该是一个问题,我认为你没有办法影响它的序列化方式.

使用前缀 ae 声明命名空间以及对 xsl:output 元素的调整的示例:

<xsl:output method="xml"版本=1.0"编码=UTF-8"缩进=是"cdata-section-elements="ae:value";独立=是"/>

Here is the part of .xml file which I need to parse

解决方案

  1. its removing the 'standalone="yes"?' part in the first line

Add standalone="yes" to the xsl:output

  1. its removing the value '[CDATA[' in element

Declare the namespace http://www.test.com/ae/types/2009 and then usecdata-section-elements="ae:value" on the xsl:output element.

  1. its combing the 'process_model_port' element in single line and adding the version at the end of it which i dont see in source file.

Are you referring to schemaVersion="007.000.004"? Because that is in the source XML. As for how the element is serialized, and whether it's one line or not, that shouldn't be a concern and I don't think you have a way to influence that in how it is serialized.

An example of declaring the namespace with the prefix ae and the adjustments to the xsl:output element:

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:ae="http://www.test.com/ae/types/2009">
  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" cdata-section-elements="ae:value" standalone="yes"/>

这篇关于使用 XSLT 在 xml 中对 uuid 进行排序的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆