小编Ten*_*nch的帖子

混合内容和字符串操作清理

我正处于将基于Word的文档转换为XML的非常痛苦的过程中.我遇到了以下问题:

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <p>
        <element>This one is taken care of.</element> Some more text. „<hi rend="italics">Is this a
            quote</hi>?” (Source). </p>

    <p>
        <element>This one is taken care of.</element> Some more text. „<hi rend="italics">This is a
            quote</hi>” (Source). </p>

    <p>
        <element>This one is taken care of.</element> Some more text. „<hi rend="italics">This is
            definitely a quote</hi>!” (Source). </p>

    <p>
        <element>This one is taken care of.</element> Some more text.„<hi rend="italics">This is a
            first quote</hi>” (Source). „<hi rend="italics">Sometimes there is a second quote …
Run Code Online (Sandbox Code Playgroud)

xml xslt xslt-2.0

5
推荐指数
1
解决办法
421
查看次数

用于合并具有相同名称和属性值的同级元素的XSLT 2.0解决方案

我正在寻找一个可以转变的解决方案

<p>
<hi rend="bold">aa</hi>
<hi rend="bold">bb</hi>
<hi rend="bold">cc</hi>
Perhaps some text.
<hi rend="italic">dd</hi>
<hi rend="italic">ee</hi>
Some more text.
<hi rend="italic">ff</hi>
<hi rend="italic">gg</hi>
Foo.
</p>
Run Code Online (Sandbox Code Playgroud)

<p>
<hi rend="bold">aabbcc</hi>
Perhaps some text.
<hi rend="italic">ddee</hi>
Perhaps some text.
<hi rend="italic">ffgg</hi>
Foo. 
</p>
Run Code Online (Sandbox Code Playgroud)

但我的解决方案应该_不硬编码元素和属性值的名称(斜体,粗体).XSLT应该真正连接具有相同名称和相同属性值的所有兄弟元素.其他一切都应保持不变.

我已经看过那里已经存在的解决方案,但它们似乎都没有满足我的所有要求.

如果有人有一个方便的XSLT样式表,我会非常感激.

xslt xslt-2.0

4
推荐指数
1
解决办法
1589
查看次数

使用jQuery对内联文本元素进行交叉淡入淡出

我正在寻找一种方法来使用jQuery正确地动画/交叉淡化内联锚元素.块元素有几种解决方案,但内联元素到目前为止还没有.

我对每个单词的替代文本来自元素中的属性:

<a data-r="nerd">word</a>?
Run Code Online (Sandbox Code Playgroud)

但如果我尝试淡出,请替换文本并淡入,如下所示:

jQuery(document).ready(function($) {
$('a').click(function(index) {
    $(this).fadeOut(500, function() {
        $(this).text($(this).attr("data-r"));
    });
    $(this).fadeIn(500);
    });
});?
Run Code Online (Sandbox Code Playgroud)

我没有得到我想要的交叉淡入淡出效果,但是在这个演示中你可以看到fadein的淡出效果.

我会非常感谢您提供的任何提示.

css jquery text jquery-ui jquery-effects

2
推荐指数
1
解决办法
1430
查看次数

标签 统计

xslt ×2

xslt-2.0 ×2

css ×1

jquery ×1

jquery-effects ×1

jquery-ui ×1

text ×1

xml ×1