小编Jim*_*mXC的帖子

XSLT排序 - 如何使用属性对父节点内的xml子节点进行排序

对于XSLT noob来说,最简单的事情已经变得非常棘手.

尝试对子节点/降序进行排序,但在向父节点添加属性后,在VS2010中调试时收到错误:

"Attribute and namespace nodes cannot be added to the parent element after a text, comment, pi, or sub-element node has already been added."

假设我有这个简单的XML:

<posts>
    <year value="2013">
        <post postid="10030" postmonth="1">
            <othernode></othernode>
            <othernode2></othernode2>
        </post>
        <post postid="10040" postmonth="2">
            <othernode></othernode>
            <othernode2></othernode2>
        </post>
        <post postid="10050" postmonth="3">
             <othernode></othernode>
             <othernode2></othernode2>
        </post>
    </year>
    <year value="2012">
        <post postid="10010" postmonth="1">
            <othernode></othernode>
            <othernode2></othernode2>
        </post>
        <post postid="10015" postmonth="2">
            <othernode></othernode>
            <othernode2></othernode2>
        </post>
        <post postid="10020" postmonth="3">
             <othernode></othernode>
             <othernode2></othernode2>
        </post>
    </year>
</posts>
Run Code Online (Sandbox Code Playgroud)

我将XPATH传递给xmldatasource以检索相关<year>节点,例如2013.然后我需要<post>使用postid 对其子节点进行降序排序,因此<year value=2013>,postid …

xml sorting xslt xpath xslt-grouping

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

Google Drive API - 使用 .NET 列出文件夹内的文件

我有一个 vb.net 应用程序可以访问 Drive。除了列出文件夹内的文件外,我一切正常。我需要从 UI 传递文件夹 ID 并显示其中的文件。

我已经阅读了其他答案,例如(通过 Drive SDK 上的文件夹获取文件列表),其中声明使用附加到 GET URL 的“q”参数,但我没有构建 GET URL。在下面运行 ListRequest 时,我看不到如何传递 Q 参数:

这会从 ROOT 返回一个文件列表,但是如何将 Q 传递给它以从指定文件夹返回文件:

    Dim result As New List(Of File)()
        Dim request As FilesResource.ListRequest = service.Files.List()

        Do
            Try
                Dim files As FileList = request.Fetch()
                result.AddRange(files.Items)
                request.PageToken = files.NextPageToken
            Catch e As Exception
                Console.WriteLine("An error occurred: " + e.Message)
                request.PageToken = Nothing
            End Try
        Loop While Not [String].IsNullOrEmpty(request.PageToken)
        Return result
Run Code Online (Sandbox Code Playgroud)

我需要传递一个像“父母中的 0B_p57qQpdddyl8nR0NBT3hXQUdIRFE”这样的 ID。文档中的 PHP 示例显示在 service.files.list() 方法中添加参数,但 …

google-drive-api

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

标签 统计

google-drive-api ×1

sorting ×1

xml ×1

xpath ×1

xslt ×1

xslt-grouping ×1