xslt-2.0 相关问题

将此标记用于特定于XSL Transformations版本2.0的问题,而不是其他版本。

如何将 XSL FO 转换为 XSLT 模板

使用transformToFragment,通过传递XSLT和XML文档,我能够实现PDF 对于另一个请求,我有 XSL FO。我们可以使用XSL FO和XML文档来生成pdf吗? 请指教 你...

回答 1 投票 0

使用 xsl:number

考虑以下 XML 文档: ...

回答 1 投票 0

XSLT 2.0 - 如何将平面 XML 结构转换为嵌套/分层 XML 结构

我想使用 XSLT 2.0 将以下平面 XML 结构转换为嵌套/分层 XML 结构。 <

回答 1 投票 0

字符串 XSLT 命名空间问题

我有一个 XSLT 文件,我想在其中使用 String 名称空间中的一堆函数。即,http://exslt.org/strings,但该网站似乎不再存在。因此我的代码如下

回答 1 投票 0

如何访问已存储在变量中的节点集? (XSLT 2.0)

我试图找出为什么这个 XSLT 没有按照我期望的方式工作。简而言之,我想将一组 XML 元素存储在变量中,然后稍后访问它们。以下是一个例子...

回答 1 投票 0

将除一个之外的 XML 元素推入 XSL 中的第二级,无需硬编码元素名称

我有以下 XML 输入。 160052-航空自卫队 160052 160052_1 输出...

回答 1 投票 0

如何将值与之前的记录进行比较,然后修改日期字段

CT|123456789|ABCDE|10202023|扣费|30.00| CT|123456789|ABCDE|10202023|扣费|30.00| <--- change the date to 10062023 I want to compare the record to the previous one, if they are identica...

回答 1 投票 0

XSLT:将文本子字符串转换为整数值

所以我正在处理像这样的一些 XML 行...... 周期 1–5 周期 6–10 所以我正在处理像这样的一些 XML 行...... <p outputclass="Heading">Cycles 1–5</p> <p outputclass="Heading">Cycles 6–10</p> <p outputclass="Heading">Cycles 11–16</p> 我想要做的就是从中取出数字,作为整数值。 我尝试过但没有成功的方法之一是...... <xsl:for-each select="p[@outputclass = 'Heading' and starts-with(., 'Cycles ')]"> <xsl:variable name="cycle_begin_string" select="substring-after(.,'Cycles ') and substring-before(.,'–')"/> <xsl:variable name="cycle_end_string" select="substring-after(., '–')"/> <xsl:variable name="cycle_begin_number" select="number($cycle_begin_string)"/> <xsl:variable name="cycle_end_number" select="number($cycle_end_string)"/> <xsl:variable name="cycle_begin_integer" select="xs:integer($cycle_begin_number)"/> <xsl:variable name="cycle_end_integer" select="xs:integer($cycle_end_number)"/> </xsl:for-each> 是的,我知道这可能会更整洁,但我故意将其分解为多个变量,以便解决问题所在。无论如何,当我这样做时,我收到一条错误消息:“无法将 double NaN 转换为整数” 我在这里缺少什么?因为我知道,被选择的内容肯定是一个数字。我认为这意味着我没有以正确的方式转换它。但我无法弄清楚。谢谢。 考虑发布一个最小但完整的示例,以及所使用的 XSLT 处理器的详细信息,以允许其他人重现该错误;根据您的问题和评论,我创建了运行 SaxonC HE 12.3 的在线示例并执行例如 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="#all" expand-text="yes"> <xsl:template match="root"> <xsl:for-each select="p[@outputclass = 'Heading' and starts-with(., 'Cycles ')]"> <xsl:variable name="cycle_end_string" select="substring-after(., '–')"/> <xsl:variable name="cycle_end_number" select="number($cycle_end_string)"/> <xsl:variable name="cycle_end_integer" select="xs:integer($cycle_end_number)"/> <div>{$cycle_end_integer}</div> </xsl:for-each> </xsl:template> <xsl:output method="xml" indent="yes"/> <xsl:mode on-no-match="shallow-copy"/> <xsl:template match="/" name="xsl:initial-template"> <xsl:next-match/> <xsl:comment>Run with {system-property('xsl:product-name')} {system-property('xsl:product-version')} at {current-dateTime()}</xsl:comment> </xsl:template> </xsl:stylesheet> 针对输入 <root> <p outputclass="Heading">Cycles 1–5</p> <p outputclass="Heading">Cycles 6–10</p> <p outputclass="Heading">Cycles 11–16</p> </root> 并且它不输出任何错误,但例如 <?xml version="1.0" encoding="UTF-8"?> <div>5</div> <div>10</div> <div>16</div> <!--Run with SAXON HE 12.3 at 2023-11-25T23:08:29.498723Z--> 就好了。

回答 1 投票 0

尝试使用xslt代码以结构化方式形成数据,但由于“<p><span" and other characters

我正在尝试使用 xslt 代码以结构化方式形成数据,但由于“”而无法读取数据 我正在尝试使用 xslt 代码以结构化方式形成数据,但由于“”而无法读取数据 这是源 xml 数据: <?xml version='1.0' encoding='UTF-8'?> <wd:Report_Data xmlns:wd="urn:com.workday/bsvc"> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Peer/Stakeholder</wd:category> <wd:questionno>1</wd:questionno> <wd:response>&lt;p>Teamwork and Puncutality&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Peer/Stakeholder</wd:category> <wd:questionno>2</wd:questionno> <wd:response>&lt;p>Constructive Feedback&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Peer/Stakeholder</wd:category> <wd:questionno>3</wd:questionno> <wd:response>4</wd:response> <wd:date>2023-11-20</wd:date> <wd:score>4</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Peer/Stakeholder</wd:category> <wd:questionno>4</wd:questionno> <wd:response>6</wd:response> <wd:date>2023-11-20</wd:date> <wd:score>6</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Direct Report</wd:category> <wd:questionno>1</wd:questionno> <wd:response>&lt;p>&lt;span>often recognizes and reward employees for positive workplace behaviors. serves as a role model by consistently behaving in line with the company’s values.&lt;/span>&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Direct Report</wd:category> <wd:questionno>2</wd:questionno> <wd:response>&lt;p>&lt;span>Can definitely use some work on being more flexible and open-minded in approach.&lt;/span>&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Peer/Stakeholder</wd:category> <wd:questionno>1</wd:questionno> <wd:response>&lt;p>&lt;span>Communicates clearly and effectively, making it easy for others to understand.&lt;/span>&lt;/p>&lt;p>&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Peer/Stakeholder</wd:category> <wd:questionno>2</wd:questionno> <wd:response>&lt;p>&lt;span>Listens attentively and responds thoughtfully to others’ ideas and concerns.&lt;/span>&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Direct Report</wd:category> <wd:questionno>1</wd:questionno> <wd:response>&lt;p>&lt;span>oftens share knowledge and ideas with other team members. consistently meets deadlines&lt;/span>&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Direct Report</wd:category> <wd:questionno>2</wd:questionno> <wd:response>&lt;p>&lt;span>work is technically good, but it needs a more creative approach to stand out.&lt;/span>&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Direct Report</wd:category> <wd:questionno>1</wd:questionno> <wd:response>&lt;p>&lt;span>Demonstrates excellent problem-solving skills, able to analyze complex problems and develop effective solutions. Displays creativity that is inspiring and has had a significant impact on the success of the project&lt;/span>&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Direct Report</wd:category> <wd:questionno>2</wd:questionno> <wd:response>&lt;p>&lt;span>Appears to be stuck in a rut and is not coming up with new ideas or approaches to address challenges&lt;/span>&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Peer/Stakeholder</wd:category> <wd:questionno>1</wd:questionno> <wd:response>&lt;p>&lt;span>Effectively summarizes information and provides relevant updates to stakeholders. Shares feedback constructively, motivating colleagues to improve performance.&lt;/span>&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Peer/Stakeholder</wd:category> <wd:questionno>2</wd:questionno> <wd:response>&lt;p>&lt;span>Has difficulty managing time effectively, leading to missed deadlines or rushed work. Has a tendency to rush work, resulting in lower quality outcomes.&lt;/span>&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Peer/Stakeholder</wd:category> <wd:questionno>1</wd:questionno> <wd:response>&lt;p>&lt;span>Feedback is an investment in each other, and peer accountability is a central tenet in Achieving Together. Thank you for giving this important responsibility the time and care it deserves! &lt;/span>&lt;/p>&lt;p>&lt;/p>&lt;p>&lt;span>This form should take approximately 15 minutes to complete. Please provide thoughtful (but concise) answers and target two to three full sentences for each question. DON’T write a novel, provide only cryptic bullets, or overthink it. DO be honest and respectful. And save your feedback responses frequently to avoid losing them!  &lt;/span>&lt;/p>&lt;p>&lt;b>&lt;span>Important notes about anonymity: &lt;/span>&lt;/b>&lt;span>&lt;b>&lt;span>Feedback you provide to your manager or peers/stakeholders will be aggregated with feedback from other respondents and &lt;i>&lt;u>shared verbatim but anonymously&lt;/u> &lt;/i>with the recipient. The manager of the feedback recipient will, however, see your attributed feedback. This is to better understand and convey helpful context to the colleague (if needed), while maintaining the feedback provider’s confidentiality. If you are a people-manager, the feedback you provide to your direct reports will &lt;i>not&lt;/i> be anonymous. &lt;/span>&lt;/b>&lt;/span>&lt;/p>&lt;p>&lt;b>&lt;span>&lt;/span>&lt;/b>&lt;/p>&lt;p>&lt;b>&lt;span>Declining to provide feedback. &lt;/span>&lt;/b>&lt;span>Under certain circumstances, declining to submit feedback for a specific recipient may be warranted. If, for example, you feel that you don’t have enough experience with the person to provide minimally helpful feedback and would like to cancel the request, please reach out to your People Partner to discuss.&lt;/span>&lt;/p>&lt;p>&lt;/p>&lt;p>&lt;span>Feedback is an investment in each other, and peer accountability is a central tenet in Achieving Together. Thank you for giving this important responsibility the time and care it deserves! &lt;/span>&lt;/p>&lt;p>&lt;/p>&lt;p>&lt;span>This form should take approximately 15 minutes to complete. Please provide thoughtful (but concise) answers and target two to three full sentences for each question. DON’T write a novel, provide only cryptic bullets, or overthink it. DO be honest and respectful. And save your feedback responses frequently to avoid losing them!  &lt;/span>&lt;/p>&lt;p>&lt;b>&lt;span>Important notes about anonymity: &lt;/span>&lt;/b>&lt;span>&lt;b>&lt;span>Feedback you provide to your manager or peers/stakeholders will be aggregated with feedback from other respondents and &lt;i>&lt;u>shared verbatim but anonymously&lt;/u> &lt;/i>with the recipient. The manager of the feedback recipient will, however, see your attributed feedback. This is to better understand and convey helpful context to the colleague (if needed), while maintaining the feedback provider’s confidentiality. If you are a people-manager, the feedback you provide to your direct reports will &lt;i>not&lt;/i> be anonymous. &lt;/span>&lt;/b>&lt;/span>&lt;/p>&lt;p>&lt;b>&lt;span>&lt;/span>&lt;/b>&lt;/p>&lt;p>&lt;b>&lt;span>Declining to provide feedback. &lt;/span>&lt;/b>&lt;span>Under certain circumstances, declining to submit feedback for a specific recipient may be warranted. If, for example, you feel that you don’t have enough experience with the person to provide minimally helpful feedback and would like to cancel the request, please reach out to your People Partner to discuss.&lt;/span>&lt;/p>&lt;p>&lt;/p>&lt;p>&lt;span>Feedback is an investment in each other, and peer accountability is a central tenet in Achieving Together. Thank you for giving this important responsibility the time and care it deserves! &lt;/span>&lt;/p>&lt;p>&lt;/p>&lt;p>&lt;span>This form should take approximately 15 minutes to complete. Please provide thoughtful (but concise) answers and target two to three full sentences for each question. DON’T write a novel, provide only cryptic bullets, or overthink it. DO be honest and respectful. And save your feedback responses frequently to avoid losing them!  &lt;/span>&lt;/p>&lt;p>&lt;b>&lt;span>Important notes about anonymity: &lt;/span>&lt;/b>&lt;span>&lt;b>&lt;span>Feedback you provide to your manager or peers/stakeholders will be aggregated with feedback from other respondents and &lt;i>&lt;u>shared verbatim but anonymously&lt;/u> &lt;/i>with the recipient. The manager of the feedback recipient will, however, see your attributed feedback. This is to better understand and convey helpful context to the colleague (if needed), while maintaining the feedback provider’s confidentiality. If you are a people-manager, the feedback you provide to your direct reports will &lt;i>not&lt;/i> be anonymous. &lt;/span>&lt;/b>&lt;/span>&lt;/p>&lt;p>&lt;b>&lt;span>&lt;/span>&lt;/b>&lt;/p>&lt;p>&lt;b>&lt;span>Declining to provide feedback. &lt;/span>&lt;/b>&lt;span>Under certain circumstances, declining to submit feedback for a specific recipient may be warranted. If, for example, you feel that you don’t have enough experience with the person to provide minimally helpful feedback and would like to cancel the request, please reach out to your People Partner to discuss.&lt;/span>&lt;/p>&lt;p>&lt;span>Feedback is an investment in each other, and peer accountability is a central tenet in Achieving Together. Thank you for giving this important responsibility the time and care it deserves! &lt;/span>&lt;/p>&lt;p>&lt;/p>&lt;p>&lt;span>This form should take approximately 15 minutes to complete. Please provide thoughtful (but concise) answers and target two to three full sentences for each question. DON’T write a novel, provide only cryptic bullets, or overthink it. DO be honest and respectful. And save your feedback responses frequently to avoid losing them!  &lt;/span>&lt;/p>&lt;p>&lt;b>&lt;span>Important notes about anonymity: &lt;/span>&lt;/b>&lt;span>&lt;b>&lt;span>Feedback you provide to your manager or peers/stakeholders will be aggregated with feedback from other respondents and &lt;i>&lt;u>shared verbatim but anonymously&lt;/u> &lt;/i>with the recipient. The manager of the feedback recipient will, however, see your attributed feedback. This is to better understand and convey helpful context to the colleague (if needed), while maintaining the feedback provider’s confidentiality. If you are a people-manager, the feedback you provide to your direct reports will &lt;i>not&lt;/i> be anonymous. &lt;/span>&lt;/b>&lt;/span>&lt;/p>&lt;p>&lt;b>&lt;span>&lt;/span>&lt;/b>&lt;/p>&lt;p>&lt;b>&lt;span>Declining to provide feedback. &lt;/span>&lt;/b>&lt;span>Under certain circumstances, declining to submit feedback for a specific recipient may be warranted. If, for example, you feel that you don’t have enough experience with the person to provide minimally helpful feedback and would like to cancel the request, please reach out to your People Partner to discuss.&lt;/span>&lt;/p>&lt;p>&lt;span>Feedback is an investment in each other, and peer accountability is a central tenet in Achieving Together. Thank you for giving this important responsibility the time and care it deserves! &lt;/span>&lt;/p>&lt;p>&lt;/p>&lt;p>&lt;span>This form should take approximately 15 minutes to complete. Please provide thoughtful (but concise) answers and target two to three full sentences for each question. DON’T write a novel, provide only cryptic bullets, or overthink it. DO be honest and respectful. And save your feedback responses frequently to avoid losing them!  &lt;/span>&lt;/p>&lt;p>&lt;b>&lt;span>Important notes about anonymity: &lt;/span>&lt;/b>&lt;span>&lt;b>&lt;span>Feedback you provide to your manager or peers/stakeholders will be aggregated with feedback from other respondents and &lt;i>&lt;u>shared verbatim but anonymously&lt;/u> &lt;/i>with the recipient. The manager of the feedback recipient will, however, see your attributed feedback. This is to better understand and convey helpful context to the colleague (if needed), while maintaining the feedback provider’s confidentiality. If you are a people-manager, the feedback you provide to your direct reports will &lt;i>not&lt;/i> be anonymous. &lt;/span>&lt;/b>&lt;/span>&lt;/p>&lt;p>&lt;b>&lt;span>&lt;/span>&lt;/b>&lt;/p>&lt;p>&lt;b>&lt;span>Declining to provide feedback. &lt;/span>&lt;/b>&lt;span>Under certain circumstances, declining to submit feedback for a specific recipient may be warranted. If, for example, you feel that you don’t have enough experience with the person to provide minimally helpful feedback and would like to cancel the request, please reach out to your People Partner to discuss.&lt;/span>&lt;/p>&lt;p>&lt;/p></wd:response> <wd:date>2023-11-21</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Peer/Stakeholder</wd:category> <wd:questionno>2</wd:questionno> <wd:response>&lt;p>test&lt;/p></wd:response> <wd:date>2023-11-21</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Direct Report</wd:category> <wd:questionno>1</wd:questionno> <wd:response>&lt;p>&lt;span>Effectively summarizes information and provides relevant updates to stakeholders. Demonstrates excellent organizational skills, keeping on top of multiple projects and responsibilities.&lt;/span>&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Direct Report</wd:category> <wd:questionno>2</wd:questionno> <wd:response>&lt;p>&lt;span>Has room for improvement in active listening skills and demonstrating empathy towards colleagues.&lt;/span>&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Peer/Stakeholder</wd:category> <wd:questionno>1</wd:questionno> <wd:response>&lt;p>&lt;span>Is a reliable team member, consistently meeting commitments and delivering high-quality work. Is committed to continuous improvement, regularly seeking feedback and making adjustments.&lt;/span>&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Peer/Stakeholder</wd:category> <wd:questionno>2</wd:questionno> <wd:response>&lt;p>&lt;span>Has a tendency to rush work, resulting in lower quality outcomes.&lt;/span>&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Direct Report</wd:category> <wd:questionno>1</wd:questionno> <wd:response>&lt;p>&lt;span>Shows pride in work, going above and beyond to ensure excellence. Takes responsibility for tasks and projects, ensuring they are completed on time and to the required standard.&lt;/span>&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Direct Report</wd:category> <wd:questionno>2</wd:questionno> <wd:response>&lt;p>&lt;span>Often requires a nudge to take the reins and identify opportunities for improvement.&lt;/span>&lt;/p></wd:response> <wd:date>2023-11-20</wd:date> <wd:score>0</wd:score> </wd:Report_Entry> <wd:Report_Entry> <wd:empid>123</wd:empid> <wd:name>Buddi</wd:name> <wd:title>Executive, Call Center</wd:title> <wd:manager>Dimbu</wd:manager> <wd:tempno>1</wd:tempno> <wd:category>Direct Report</wd:category> <wd:questionno>4</wd:questionno> <wd:response>6</wd:response> <wd:date>2023-11-20</wd:date> <wd:score>6</wd:score> </wd:Report_Entry> </wd:Report_Data> 这是xslt代码,我尝试了但没有获得MRQ1,DRQ1,PSQ1,DRPSQ1,MRQ2,DRQ2,PSQ2,DRPSQ2的数据结果。 <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:is="java:com.workday.esb.intsys.xpath.ParsedIntegrationSystemFunctions" xmlns:xdiff="urn:com.workday/esb/xdiff" xmlns:wd="urn:com.workday/bsvc"> <xsl:output method="xml" indent="yes" omit-xml-declaration="no"/> <xsl:variable name="response" select="'Response'"/> <xsl:function name="wd:formatPSQ"> <xsl:param name="psqValue"/> <xsl:param name="lastElement"/> <xsl:value-of select="concat('{\&quot;Response\&quot;:{\&quot;', $psqValue, '\&quot;}')"/> <xsl:if test="$lastElement = false()"> <xsl:value-of select="','"/> </xsl:if> </xsl:function> <xsl:template match="/"> <Report_Data> <xsl:apply-templates select="wd:Report_Data"/> </Report_Data> </xsl:template> <xsl:template match="wd:Report_Data"> <xsl:for-each-group select="wd:Report_Entry" group-by="wd:empid"> <Report_Entry> <empid> <xsl:value-of select="wd:empid"/> </empid> <name> <xsl:value-of select="wd:name"/> </name> <title> <xsl:value-of select="wd:title"/> </title> <manager> <xsl:value-of select="wd:manager"/> </manager> <tempno> <xsl:value-of select="wd:tempno"/> </tempno> <MRQ1> <xsl:if test="(current-group()[wd:category = 'Manager' and wd:questionno = '1']/wd:response)"> <xsl:text>[</xsl:text> <xsl:for-each select="current-group()[wd:category = 'Manager' and wd:questionno = '1']"> <xsl:text>{"Response":"</xsl:text> <xsl:value-of select="wd:response/*"/> <xsl:text>"}</xsl:text> <xsl:if test="position() != last()">,</xsl:if> </xsl:for-each> <xsl:text>]</xsl:text> </xsl:if> </MRQ1> <DRQ1> <xsl:if test="(current-group()[wd:category = 'Direct Report' and wd:questionno = '1']/wd:response)"> <xsl:text>[</xsl:text> <xsl:for-each select="current-group()[wd:category = 'Direct Report' and wd:questionno = '1']"> <xsl:value-of select="wd:formatPSQ(wd:response/p, (position() = last()))"/> </xsl:for-each> <xsl:text>]</xsl:text> </xsl:if> </DRQ1> <PSQ1> <xsl:if test="(current-group()[wd:category = 'Peer/Stakeholder' and wd:questionno = '1']/wd:response)"> <xsl:text>[</xsl:text> <xsl:for-each select="current-group()[wd:category = 'Peer/Stakeholder' and wd:questionno = '1']"> <xsl:text>{"Response":"</xsl:text> <xsl:value-of select="wd:response/*"/> <xsl:text>"}</xsl:text> <xsl:if test="position() != last()">,</xsl:if> </xsl:for-each> <xsl:text>]</xsl:text> </xsl:if> </PSQ1> <DRPSQ1> <xsl:if test="(current-group()[(wd:category = 'Peer/Stakeholder' or wd:category = 'Direct Report') and wd:questionno = '1']/wd:response)"> <xsl:text>[</xsl:text> <xsl:for-each select="current-group()[(wd:category = 'Peer/Stakeholder' or wd:category = 'Direct Report') and wd:questionno = '1']"> <xsl:text>{"Response":"</xsl:text> <xsl:value-of select="wd:response/*"/> <xsl:text>"}</xsl:text> <xsl:if test="position() != last()">,</xsl:if> </xsl:for-each> <xsl:text>]</xsl:text> </xsl:if> </DRPSQ1> <MRQ2> <xsl:if test="(current-group()[wd:category = 'Manager' and wd:questionno = '2']/wd:response)"> <xsl:text>[</xsl:text> <xsl:for-each select="current-group()[wd:category = 'Manager' and wd:questionno = '2']"> <xsl:text>{"Response":"</xsl:text> <xsl:value-of select="wd:response/*"/> <xsl:text>"}</xsl:text> <xsl:if test="position() != last()">,</xsl:if> </xsl:for-each> <xsl:text>]</xsl:text> </xsl:if> </MRQ2> <DRQ2> <xsl:if test="(current-group()[wd:category = 'Direct Report' and wd:questionno = '2']/wd:response)"> <xsl:text>[</xsl:text> <xsl:for-each select="current-group()[wd:category = 'Direct Report' and wd:questionno = '2']"> <xsl:value-of select="wd:formatPSQ(wd:response/p, (position() = last()))"/> </xsl:for-each> <xsl:text>]</xsl:text> </xsl:if> </DRQ2> <PSQ2> <xsl:if test="(current-group()[wd:category = 'Peer/Stakeholder' and wd:questionno = '2']/wd:response)"> <xsl:text>[</xsl:text> <xsl:for-each select="current-group()[wd:category = 'Peer/Stakeholder' and wd:questionno = '2']"> <xsl:value-of select="wd:formatPSQ(wd:response/p, (position() = last()))"/> </xsl:for-each> <xsl:text>]</xsl:text> </xsl:if> </PSQ2> <DRPSQ2> <xsl:if test="(current-group()[(wd:category = 'Peer/Stakeholder' or wd:category = 'Direct Report') and wd:questionno = '2']/wd:response)"> <xsl:text>[</xsl:text> <xsl:for-each select="current-group()[(wd:category = 'Peer/Stakeholder' or wd:category = 'Direct Report') and wd:questionno = '2']"> <xsl:value-of select="wd:formatPSQ(wd:response/p, (position() = last()))"/> </xsl:for-each> <xsl:text>]</xsl:text> </xsl:if> </DRPSQ2> </Report_Entry> </xsl:for-each-group> </xsl:template> </xsl:stylesheet> 以下是员工 PSQ1 的预期结果样本: <PSQ1>[ {"Response": "You adopted a practical approach to problem-solving and building trust with others came easy to you"}, {"Response": "Skillfully overcomes client objections. A loyal and trustworthy employee."}, {"Response": "Takes initiative to identify and address challenges or opportunities withoutbeing prompted. Shows creativity and innovation in identifying new solutions or approaches to tasks and projects."} ]</PSQ1> 尝试将 PSQ1 的代码更改为: <PSQ1> <xsl:if test="(current-group()[wd:category = 'Peer/Stakeholder' and wd:questionno = '1']/wd:response)"> <xsl:text>[</xsl:text> <xsl:for-each select="current-group()[wd:category = 'Peer/Stakeholder' and wd:questionno = '1']/parse-xml-fragment(wd:response)/p"> <xsl:text>{"Response":"</xsl:text> <xsl:value-of select="."/> <xsl:text>"}</xsl:text> <xsl:if test="position() != last()">,</xsl:if> </xsl:for-each> <xsl:text>]</xsl:text> </xsl:if> </PSQ1> 对于其他有问题的领域也是如此。

回答 1 投票 0

需要使用 xslt 计算一组数字的中位数

需要帮助使用 xslt 计算一组数字的中位数。 例如:我得到的第一个 Empid 的 PSQ3_Values 是 8 6 8,需要从中获取中值。例如:排序:6,8,8,中位数为 8。 正在获取 PSQ3_V...

回答 1 投票 0

如果在指定日期范围内,如何申请每个组并为每个列出的代码返回 1 行?

我正在尝试在代码中创建几个嵌套循环,以按 Time_Data/Time_Off/Code 进行分组。我想在输出中的 1 行上显示连续几天内的所有休假代码。任何补充...

回答 1 投票 0

需要帮助使用 xslt 列出数组中的值

需要帮助使用 xslt 列出数组中的值。目前,它们显示为一行一行,需要值才能在数组中显示它们。 附件是源 xml 和 xslt 尝试过但不确定...

回答 1 投票 0

从主 XSLT 映射调用多个 XSLT 映射

我们可以从主 XSLT 映射中调用多个 XSLT 映射吗?基于条件匹配? 示例 XML: ...

回答 1 投票 0

为 XSLT 中的特定元素创建序列

我正在尝试创建一个函数,按顺序将数字分配给 xml 元素。让我举一个例子。我想要的输出 xml 是这样的: ...

回答 1 投票 0

我在数据中得到像<p>这样的特殊字符,并且需要像行一样格式化

我已将数据组合到一个元素中,但获取带有特殊字符的数据。例如:在下面的 xml 中,我在字段中得到类似 。 这…… 我已将数据组合到一个元素中,但获取带有特殊字符的数据。例如:在下面的 xml 中,我在字段中获取类似 &lt;/p>&lt;p>&lt;span 的值:<PSQ2>。 这应该如下所示: 需要知道出现这种情况的原因。在上一步中,我使用 XSLT 将所有值合并为一个。 PSQ2的期望值: 超出工作时间以满足发布时间表和其他优先事项。 就技能而言,我觉得他技术非常好。举止方面,他非常友善,让人觉得他是家庭成员之一。他以个人和专业的方式为人们提供建议。到目前为止我没觉得他有三心二意。 他表现出了良好的分析问题、做出正确决策和克服问题的能力。始终努力提高代码质量。 输入XML: <?xml version='1.0' encoding='UTF-8'?> <wd:Report_Entry xmlns:wd="urn:com.workday/bsvc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:is="java:com.workday.esb.intsys.xpath.ParsedIntegrationSystemFunctions" xmlns:xdiff="urn:com.workday/esb/xdiff"> <empid>123</empid> <name>Ramu</name> <title>Software Architect</title> <manager>Ahmed</manager> <tempno>2</tempno> <MRQ2>&lt;p>Excellent technical knowledge, problem solving capabilities, team player&lt;/p></MRQ2> <DRQ2/> <PSQ2>&lt;p>Going beyond working hours to meet release timeline and other priority stuff.&lt;/p>&lt;p>Skill set wise, I feel he is technically very well sound. Behavior wise, he is very friendly, make people feel like he is one of a family member. He advices people in both personal and professional ways. So far I didn&amp;#39;t feel that he keeps double thoughts.&lt;/p>&lt;p>&lt;span>He has shown good ability to analyze issues, make sound decisions and overcome problems. Always trying to improve code quality. &lt;/span>&lt;/p></PSQ2> <MRQ3>&lt;p>Evangelize the design thinking, groom junior devs, create technical vision&lt;/p></MRQ3> <DRQ3/> <PSQ3>&lt;p>Keep your momentum and work towards making Conga Platform UI a great success.&lt;/p>&lt;p>I think he should learn how to be visible till the highest level. Like, he does many better things, however, I feel his visibility is not that much. Credits which should come to him are somehow going to somebody else. So he should learn how to present what he has done in such a way so that all deserved credits goes to him, everything that he does are acknowledged by higher management. This can be possible through better communication and presentation skills.&lt;/p>&lt;p>He can learn and try out new technology and different tools which can provide alternative to solve a problem in the most ideal way.&lt;/p></PSQ3> <MRQ4>9</MRQ4> <DRQ4_Min/> <DRQ4_Max/> <DRQ4_Median/> <PSQ4_Min>8</PSQ4_Min> <PSQ4_Max>9</PSQ4_Max> <PSQ4_Median>8.0</PSQ4_Median> <MRQ6>9</MRQ6> <DRQ6_Min/> <DRQ6_Max/> <DRQ6_Median/> <PSQ6_Min>6</PSQ6_Min> <PSQ6_Max>8</PSQ6_Max> <PSQ6_Median>8.0</PSQ6_Median> </wd:Report_Entry> 为了获得上面的 xml,我使用下面的 XSLT 来组合数据。我不确定我在这个 XSLT 中是否做错了: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:is="java:com.workday.esb.intsys.xpath.ParsedIntegrationSystemFunctions" xmlns:xdiff="urn:com.workday/esb/xdiff" xmlns:wd="urn:com.workday/bsvc"> <xsl:output method="xml" indent="yes" omit-xml-declaration="no"/> <xsl:template match="/"> <Report_Data> <xsl:apply-templates select="wd:Report_Data"/> </Report_Data> </xsl:template> <xsl:template match="wd:Report_Data"> <xsl:for-each-group select="wd:Report_Entry" group-by="wd:empid"> <Report_Entry> <empid> <xsl:value-of select="wd:empid"/> </empid> <name> <xsl:value-of select="wd:name"/> </name> <title> <xsl:value-of select="wd:title"/> </title> <manager> <xsl:value-of select="wd:manager"/> </manager> <tempno> <xsl:value-of select="wd:tempno"/> </tempno> <MRQ2> <xsl:for-each select="current-group()[wd:category = 'Manager' and wd:questionno='2' ]"> <xsl:value-of select="wd:response"/> </xsl:for-each> </MRQ2> <DRQ2> <xsl:for-each select="current-group()[wd:category = 'Direct Report' and wd:questionno='2' ]"> <xsl:value-of select="wd:response"/> </xsl:for-each> </DRQ2> <PSQ2> <xsl:for-each select="current-group()[wd:category = 'Peer/Stakeholder' and wd:questionno='2' ]"> <xsl:value-of select="wd:response"/> </xsl:for-each> </PSQ2> <MRQ3> <xsl:for-each select="current-group()[wd:category = 'Manager' and wd:questionno='3' ]"> <xsl:value-of select="wd:response"/> </xsl:for-each> </MRQ3> <DRQ3> <xsl:for-each select="current-group()[wd:category = 'Direct Report' and wd:questionno='3' ]"> <xsl:value-of select="wd:response"/> </xsl:for-each> </DRQ3> <PSQ3> <xsl:for-each select="current-group()[wd:category = 'Peer/Stakeholder' and wd:questionno='3' ]"> <xsl:value-of select="wd:response"/> </xsl:for-each> </PSQ3> <MRQ4> <xsl:for-each select="current-group()[wd:category = 'Manager' and wd:questionno='4' ]"> <xsl:value-of select="wd:response"/> </xsl:for-each> </MRQ4> <DRQ4_Min> <xsl:for-each select="current-group()[wd:category = 'Direct Report' and wd:questionno='4']"> <xsl:sort select="wd:response" data-type="number" order="ascending"/> <xsl:if test="position() = 1"> <xsl:value-of select="wd:response"/> </xsl:if> </xsl:for-each> </DRQ4_Min> <DRQ4_Max> <xsl:for-each select="current-group()[wd:category = 'Direct Report' and wd:questionno='4']"> <xsl:sort select="wd:response" data-type="number" order="descending"/> <xsl:if test="position() = 1"> <xsl:value-of select="wd:response"/> </xsl:if> </xsl:for-each> </DRQ4_Max> <DRQ4_Median> <xsl:for-each select="current-group()[wd:category = 'Direct Report' and wd:questionno='4']"> <xsl:sort select="wd:response" data-type="number" order="ascending"/> <xsl:variable name="pos" select="position()"/> <xsl:variable name="length" select="last()"/> <xsl:if test="$pos = floor($length div 2) + 1"> <xsl:value-of select="format-number(sum(wd:response),'#.###')"/> </xsl:if> </xsl:for-each> </DRQ4_Median> <PSQ4_Min> <xsl:for-each select="current-group()[wd:category = 'Peer/Stakeholder' and wd:questionno='4']"> <xsl:sort select="wd:response" data-type="number" order="ascending"/> <xsl:if test="position() = 1"> <xsl:value-of select="wd:response"/> </xsl:if> </xsl:for-each> </PSQ4_Min> <PSQ4_Max> <xsl:for-each select="current-group()[wd:category = 'Peer/Stakeholder' and wd:questionno='4']"> <xsl:sort select="wd:response" data-type="number" order="descending"/> <xsl:if test="position() = 1"> <xsl:value-of select="wd:response"/> </xsl:if> </xsl:for-each> </PSQ4_Max> <PSQ4_Median> <xsl:for-each select="current-group()[wd:category = 'Peer/Stakeholder' and wd:questionno='4']"> <xsl:sort select="wd:response" data-type="number" order="ascending"/> <xsl:variable name="pos" select="position()"/> <xsl:variable name="length" select="last()"/> <xsl:if test="$pos = floor($length div 2) + 1"> <xsl:value-of select="format-number(sum(wd:response),'#.###')"/> </xsl:if> </xsl:for-each> </PSQ4_Median> <MRQ6> <xsl:for-each select="current-group()[wd:category = 'Manager' and wd:questionno='6' ]"> <xsl:value-of select="wd:response"/> </xsl:for-each> </MRQ6> <DRQ6_Min> <xsl:for-each select="current-group()[wd:category = 'Direct Report' and wd:questionno='6']"> <xsl:sort select="wd:response" data-type="number" order="ascending"/> <xsl:if test="position() = 1"> <xsl:value-of select="wd:response"/> </xsl:if> </xsl:for-each> </DRQ6_Min> <DRQ6_Max> <xsl:for-each select="current-group()[wd:category = 'Direct Report' and wd:questionno='6']"> <xsl:sort select="wd:response" data-type="number" order="descending"/> <xsl:if test="position() = 1"> <xsl:value-of select="wd:response"/> </xsl:if> </xsl:for-each> </DRQ6_Max> <DRQ6_Median> <xsl:for-each select="current-group()[wd:category = 'Direct Report' and wd:questionno='6']"> <xsl:sort select="wd:response" data-type="number" order="ascending"/> <xsl:variable name="pos" select="position()"/> <xsl:variable name="length" select="last()"/> <xsl:if test="$pos = floor($length div 2) + 1"> <xsl:value-of select="format-number(sum(wd:response),'#.###')"/> </xsl:if> </xsl:for-each> </DRQ6_Median> <PSQ6_Min> <xsl:for-each select="current-group()[wd:category = 'Peer/Stakeholder' and wd:questionno='6']"> <xsl:sort select="wd:response" data-type="number" order="ascending"/> <xsl:if test="position() = 1"> <xsl:value-of select="wd:response"/> </xsl:if> </xsl:for-each> </PSQ6_Min> <PSQ6_Max> <xsl:for-each select="current-group()[wd:category = 'Peer/Stakeholder' and wd:questionno='6']"> <xsl:sort select="wd:response" data-type="number" order="descending"/> <xsl:if test="position() = 1"> <xsl:value-of select="wd:response"/> </xsl:if> </xsl:for-each> </PSQ6_Max> <PSQ6_Median> <xsl:for-each select="current-group()[wd:category = 'Peer/Stakeholder' and wd:questionno='6']"> <xsl:sort select="wd:response" data-type="number" order="ascending"/> <xsl:variable name="pos" select="position()"/> <xsl:variable name="length" select="last()"/> <xsl:if test="$pos = floor($length div 2) + 1"> <xsl:value-of select="format-number(sum(wd:response),'#.###')"/> </xsl:if> </xsl:for-each> </PSQ6_Median> </Report_Entry> </xsl:for-each-group> </xsl:template> </xsl:stylesheet> 考虑以下简化示例: XML <PSQ2>&lt;p>Going beyond working hours to meet release timeline and other priority stuff.&lt;/p>&lt;p>Skill set wise, I feel he is technically very well sound. Behavior wise, he is very friendly, make people feel like he is one of a family member. He advices people in both personal and professional ways. So far I didn&amp;#39;t feel that he keeps double thoughts.&lt;/p>&lt;p>&lt;span>He has shown good ability to analyze issues, make sound decisions and overcome problems. Always trying to improve code quality. &lt;/span>&lt;/p></PSQ2> XSLT 3.0 <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="PSQ2"> <result> <xsl:value-of select="parse-xml-fragment(.)/p" /> </result> </xsl:template> </xsl:stylesheet> 结果 <?xml version="1.0" encoding="UTF-8"?> <result>Going beyond working hours to meet release timeline and other priority stuff. Skill set wise, I feel he is technically very well sound. Behavior wise, he is very friendly, make people feel like he is one of a family member. He advices people in both personal and professional ways. So far I didn't feel that he keeps double thoughts. He has shown good ability to analyze issues, make sound decisions and overcome problems. Always trying to improve code quality. </result> parse-xml-fragment()功能需要支持XSLT 3.0的处理器。如果没有这个,从转义标记中提取文本将变得更加困难。 补充: 将转义标记解析为 XML 后,您可以按照您喜欢的任何方式将其处理为 XML - 例如: <xsl:template match="PSQ2"> <result> <xsl:for-each select="parse-xml-fragment(.)/p"> <xsl:number format="1. "/> <xsl:value-of select="." /> <xsl:text>&#10;</xsl:text> </xsl:for-each> </result> </xsl:template> 会产生: <result>1. Going beyond working hours to meet release timeline and other priority stuff. 2. Skill set wise, I feel he is technically very well sound. Behavior wise, he is very friendly, make people feel like he is one of a family member. He advices people in both personal and professional ways. So far I didn't feel that he keeps double thoughts. 3. He has shown good ability to analyze issues, make sound decisions and overcome problems. Always trying to improve code quality. </result>

回答 1 投票 0

xpath 未返回预期输出

尝试过: 格式编号( 和( 祖先::*:策略//*:CommlCoverage [*:EffectiveDt=当前()/祖先::*:CommlCoverage/*:EffectiveDt] [*:ExpirationDt=当前...

回答 1 投票 0

回答 1 投票 0

XSLT 2.0:根据条件分组和复制节点

这是我的源 XML 67896 ...

回答 1 投票 0

使用 XSLT 重构 JSON 负载

我有以下 JSON 有效负载,我正在尝试将其重组为第二种格式 { “数据”:{ “美元瑞郎:CUR”:{ “PX_LAST”:104.4872,“CHG_PCT_1D”:0.3148063,“

回答 1 投票 0

XSLT 2.0:分组和求和问题

这是我的源 XML 12354 <

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.