小编Jan*_*Doe的帖子

XML Schema - 字符串列表

元素必须具有"字符串列表"类型,并且可以存在0或更多地出现该类型的信息.所以我做的是:

<xs:element name="xxx" type="ooo" />

<xs:simpleType name="ooo">
   <xs:list itemType="xs:string" />
</xs:simpleType>
Run Code Online (Sandbox Code Playgroud)

我相信这是正确的,但是

我在哪里放minOccur,并maxOccur在这里?

xml schema list

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

我不明白西格玛符号和循环

我有那本书说的

在此输入图像描述

并说这相当于说

for(i = 1; i <= N; i++)
    Sum += i;
Run Code Online (Sandbox Code Playgroud)

并进一步说利用这个简单的公式,

在此输入图像描述

自(最大值 - 最小值+ 1)

它说将此更改为C代码

for(k = j; k <= 1; k++)
    Sum += k;
Run Code Online (Sandbox Code Playgroud)

但是,我真的无法理解这一点!任何人都可以向我解释这个?????

非常感谢你

algorithm for-loop

8
推荐指数
1
解决办法
1万
查看次数

XSLT无法正常工作

您好我的XML文档和XSLT无法生成良好的HTML ...发生了什么?

这基本上是XML文件,我已经使用XML Schema验证了这一点

当我使用XSLT文件将其转换为HTML文件时,它只生成带有一大段文本的Courses Catalog标题.

我有什么问题吗?

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <!-- Generate HTML output -->
  <xsl:output method="html"/>

  <!-- The root template is defined here -->
  <xsl:template match="/">
<html>
  <head>
    <title>Courses Catalogue</title>
  </head>
  <body>
    <h2>Courses catalogue</h2>
    <xsl:apply-templates />
  </body>
</html>
 </xsl:template>

  <xsl:template match="course">

<p>
    <xsl:apply-templates select="code" />
    <xsl:apply-templates select="title" />
    <xsl:apply-templates select="year" />
    <xsl:apply-templates select="science" />
    <xsl:apply-templates select="area" />
    <xsl:apply-templates select="subject" />
    <xsl:apply-templates select="updated" />
    <xsl:apply-templates select="unit" />
    <xsl:apply-templates select="description" />
    <xsl:apply-templates select="outcomes" />
    <xsl:apply-templates select="incompatibility" />

</p>

  </xsl:template> …
Run Code Online (Sandbox Code Playgroud)

xslt

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

xsl:sort:按数值排序

我必须按数字顺序整理代码.代码有四个字符和四个数字.

例如,

COMP2100
COMP2400
COMP3410
LAWS2202
LAWS2250
Run Code Online (Sandbox Code Playgroud)

当我这样做<xsl:sort select="code" order="ascending" /> 时显示上面的结果.

但是,我希望它是'数字顺序'

COMP2100
LAWS2202
COMP2250
COMP2400
COMP3410
Run Code Online (Sandbox Code Playgroud)

我该怎么做呢?

sorting xslt numerical

3
推荐指数
1
解决办法
1万
查看次数

XML中的HTML标记

我想在XML文件中使用html标签,所以在我的xsd文件中,我允许html格式化:

        <xs:element name="description">
            <xs:complexType mixed="true">
                <xs:sequence>
                    <xs:any namespace="http://www.w3.org/1999/xhtml"
                            processContents="lax"
                            minOccurs="0"
                            maxOccurs="unbounded" />
                </xs:sequence>          
            </xs:complexType>
        </xs:element>
Run Code Online (Sandbox Code Playgroud)

在我的XML文件中

<description>
    <p xmlns="http://www.w3.org/1999/xhtml"> This course is an introduction to the information technologies required for secure, practical information systems for electronic commerce.
Topics will be chosen from areas such as document representation (XML, DTDs, XML Schema, XSLT, CSS), 
</p> security (encryption, public key, symmetric key, 
PKI, authentication); kinds of attack and vulnerabilities, electronic trading (spontaneous, deliberative, auctions), electronic document management 
(metadata, search, digital libraries, management …
Run Code Online (Sandbox Code Playgroud)

html xml xslt

0
推荐指数
1
解决办法
1万
查看次数

标签 统计

xslt ×3

xml ×2

algorithm ×1

for-loop ×1

html ×1

list ×1

numerical ×1

schema ×1

sorting ×1