Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions shortcuts/slides/slides_add_slide_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/larksuite/cli/internal/httpmock"
)

const testSlideXML = `<slide xmlns="http://www.larkoffice.com/sml/2.0"><data><shape type="text" topLeftX="80" topLeftY="80" width="800" height="120"><content textType="title"><p>hi</p></content></shape></data></slide>`
const testSlideXML = `<slide xmlns="https://www.larkoffice.com/sml/2.0"><data><shape type="text" topLeftX="80" topLeftY="80" width="800" height="120"><content textType="title"><p>hi</p></content></shape></data></slide>`

func TestAddSlideDeclaredScopes(t *testing.T) {
// Pre-flight must stay at the two slides scopes: an XML-only page needs
Expand Down Expand Up @@ -161,7 +161,7 @@ func TestAddSlideUploadsImagePlaceholder(t *testing.T) {
reg.Register(slideStub)

// The same image referenced twice must still upload once.
slideXML := `<slide xmlns="http://www.larkoffice.com/sml/2.0"><data>` +
slideXML := `<slide xmlns="https://www.larkoffice.com/sml/2.0"><data>` +
`<img src="@./chart.png" topLeftX="10" topLeftY="10" width="100" height="100"/>` +
`<img src="@./chart.png" topLeftX="200" topLeftY="10" width="100" height="100"/>` +
`</data></slide>`
Expand Down Expand Up @@ -202,7 +202,7 @@ func TestAddSlideRejectsNonSlideRoot(t *testing.T) {
err := runSlidesShortcut(t, f, stdout, SlidesAddSlide, []string{
"+add-slide",
"--presentation", "pres_abc",
"--slide", `<presentation xmlns="http://www.larkoffice.com/sml/2.0"><slide/></presentation>`,
"--slide", `<presentation xmlns="https://www.larkoffice.com/sml/2.0"><slide/></presentation>`,
"--as", "user",
})
if err == nil {
Expand Down Expand Up @@ -360,7 +360,7 @@ func TestAddSlideDryRunPlansUploadsBeforePost(t *testing.T) {
withSlidesTestWorkingDir(t, dir)

f, stdout, _, _ := cmdutil.TestFactory(t, slidesTestConfig(t, ""))
slideXML := `<slide xmlns="http://www.larkoffice.com/sml/2.0"><data>` +
slideXML := `<slide xmlns="https://www.larkoffice.com/sml/2.0"><data>` +
`<img src="@./chart.png" topLeftX="10" topLeftY="10" width="100" height="100"/>` +
`</data></slide>`

Expand Down Expand Up @@ -526,7 +526,7 @@ func TestAddSlideReportsUploadedImagesWhenPageFails(t *testing.T) {
Body: map[string]interface{}{"code": 3350001, "msg": "invalid slide xml"},
})

slideXML := `<slide xmlns="http://www.larkoffice.com/sml/2.0"><data>` +
slideXML := `<slide xmlns="https://www.larkoffice.com/sml/2.0"><data>` +
`<img src="@./chart.png" topLeftX="10" topLeftY="10" width="100" height="100"/>` +
`</data></slide>`

Expand Down Expand Up @@ -576,7 +576,7 @@ func TestAddSlideReportsProgressWhenUploadFails(t *testing.T) {
// The slide endpoint is deliberately unstubbed: reaching it would fail as
// "no stub for POST .../slide", which is the no-page-created assertion.

slideXML := `<slide xmlns="http://www.larkoffice.com/sml/2.0"><data>` +
slideXML := `<slide xmlns="https://www.larkoffice.com/sml/2.0"><data>` +
`<img src="@./chart.png" topLeftX="10" topLeftY="10" width="100" height="100"/>` +
`</data></slide>`

Expand Down
2 changes: 1 addition & 1 deletion shortcuts/slides/slides_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func buildPresentationXML(title string) string {
escapedTitle = "Untitled"
}
return fmt.Sprintf(
`<presentation xmlns="http://www.larkoffice.com/sml/2.0" width="%d" height="%d"><title>%s</title></presentation>`,
`<presentation xmlns="https://www.larkoffice.com/sml/2.0" width="%d" height="%d"><title>%s</title></presentation>`,
Comment thread
ethan-zhx marked this conversation as resolved.
defaultPresentationWidth, defaultPresentationHeight, escapedTitle,
)
}
Expand Down
20 changes: 14 additions & 6 deletions shortcuts/slides/slides_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ func TestSlidesCreateBasic(t *testing.T) {
}
}

func TestBuildPresentationXMLUsesCanonicalHTTPSNamespace(t *testing.T) {
got := buildPresentationXML("Demo")
want := `<presentation xmlns="https://www.larkoffice.com/sml/2.0" width="960" height="540"><title>Demo</title></presentation>`
if got != want {
t.Fatalf("buildPresentationXML() = %q, want %q", got, want)
}
}

// TestSlidesCreateBotAutoGrant verifies that bot mode grants the current user full_access on the new presentation.
func TestSlidesCreateBotAutoGrant(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -324,7 +332,7 @@ func TestSlidesCreateWithSlides(t *testing.T) {
},
})

slidesJSON := `["<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><data></data></slide>","<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><data></data></slide>"]`
slidesJSON := `["<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data></data></slide>","<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data></data></slide>"]`
Comment thread
ethan-zhx marked this conversation as resolved.
err := runSlidesCreateShortcut(t, f, stdout, []string{
"+create",
"--title", "With Slides",
Expand Down Expand Up @@ -380,7 +388,7 @@ func TestSlidesCreatePreservesSchemaIssues(t *testing.T) {

err := runSlidesCreateShortcut(t, f, stdout, []string{
"+create",
"--slides", `["<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><data/></slide>"]`,
"--slides", `["<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data/></slide>"]`,
"--as", "user",
})
if err != nil {
Expand Down Expand Up @@ -441,7 +449,7 @@ func TestSlidesCreateWithSlidesPartialFailure(t *testing.T) {
},
})

slidesJSON := `["<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><data></data></slide>","<bad-xml>"]`
slidesJSON := `["<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data></data></slide>","<bad-xml>"]`
err := runSlidesCreateShortcut(t, f, stdout, []string{
"+create",
"--title", "Partial",
Expand Down Expand Up @@ -624,7 +632,7 @@ func TestSlidesCreateWithSlidesDryRun(t *testing.T) {
t.Parallel()

f, stdout, _, _ := cmdutil.TestFactory(t, slidesTestConfig(t, ""))
slidesJSON := `["<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><data></data></slide>","<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><data></data></slide>"]`
slidesJSON := `["<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data></data></slide>","<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data></data></slide>"]`
err := runSlidesCreateShortcut(t, f, stdout, []string{
"+create",
"--title", "DryRun Slides",
Expand Down Expand Up @@ -856,8 +864,8 @@ func TestSlidesCreateWithImagePlaceholders(t *testing.T) {
reg.Register(slideStub2)

slidesJSON := `[
"<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><data><img src=\"@a.png\" topLeftX=\"10\"/><img src=\"@b.png\" topLeftX=\"20\"/></data></slide>",
"<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><data><img src=\"@a.png\" topLeftX=\"30\"/></data></slide>"
"<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data><img src=\"@a.png\" topLeftX=\"10\"/><img src=\"@b.png\" topLeftX=\"20\"/></data></slide>",
"<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data><img src=\"@a.png\" topLeftX=\"30\"/></data></slide>"
]`
err := runSlidesCreateShortcut(t, f, stdout, []string{
"+create",
Expand Down
10 changes: 5 additions & 5 deletions shortcuts/slides/slides_replace_pages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestReplacePagesCreatesBeforeThenDeletesOld(t *testing.T) {
}
reg.Register(deleteStub)

pages := `[{"slide_id":"old2","content":"<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><data></data></slide>"}]`
pages := `[{"slide_id":"old2","content":"<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data></data></slide>"}]`
err := runSlidesShortcut(t, f, stdout, SlidesReplacePages, []string{
"+replace-pages",
"--presentation", "pres_abc",
Expand Down Expand Up @@ -159,8 +159,8 @@ func TestReplacePagesContinueOnErrorReturnsPartialFailure(t *testing.T) {
})

pages := `[
{"slide_id":"old1","content":"<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><data></data></slide>"},
{"slide_id":"old2","content":"<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><data></data></slide>"}
{"slide_id":"old1","content":"<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data></data></slide>"},
{"slide_id":"old2","content":"<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data></data></slide>"}
]`
err := runSlidesShortcut(t, f, stdout, SlidesReplacePages, []string{
"+replace-pages",
Expand Down Expand Up @@ -222,7 +222,7 @@ func TestReplacePagesContinueOnErrorDeleteFailureIncludesNewSlideID(t *testing.T
},
})

pages := `[{"slide_id":"old1","content":"<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><data></data></slide>"}]`
pages := `[{"slide_id":"old1","content":"<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data></data></slide>"}]`
err := runSlidesShortcut(t, f, stdout, SlidesReplacePages, []string{
"+replace-pages",
"--presentation", "pres_abc",
Expand Down Expand Up @@ -257,7 +257,7 @@ func TestReplacePagesDryRunPlansOnly(t *testing.T) {

f, stdout, _, _ := cmdutil.TestFactory(t, slidesTestConfig(t, ""))

pages := `[{"slide_id":"old2","content":"<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><data></data></slide>"}]`
pages := `[{"slide_id":"old2","content":"<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data></data></slide>"}]`
err := runSlidesShortcut(t, f, stdout, SlidesReplacePages, []string{
"+replace-pages",
"--presentation", "pres_abc",
Expand Down
14 changes: 7 additions & 7 deletions shortcuts/slides/slides_screenshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ func TestSlidesScreenshotRenderContentWritesFile(t *testing.T) {
dir := t.TempDir()
withSlidesTestWorkingDir(t, dir)

content := `<slide xmlns="http://www.larkoffice.com/sml/2.0"><data></data></slide>`
content := `<slide xmlns="https://www.larkoffice.com/sml/2.0"><data></data></slide>`
if err := os.WriteFile(filepath.Join(dir, "slide.xml"), []byte(content), 0o644); err != nil {
t.Fatalf("write input xml: %v", err)
}
Expand Down Expand Up @@ -792,7 +792,7 @@ func TestSlidesScreenshotRenderRejectsSlideSelectors(t *testing.T) {

err := runSlidesShortcut(t, f, stdout, SlidesScreenshot, []string{
"+screenshot",
"--content", `<slide xmlns="http://www.larkoffice.com/sml/2.0"><data></data></slide>`,
"--content", `<slide xmlns="https://www.larkoffice.com/sml/2.0"><data></data></slide>`,
"--slide-id", "slide_1",
"--as", "user",
})
Expand All @@ -813,7 +813,7 @@ func TestSlidesScreenshotRenderRejectsSlideNumberSelector(t *testing.T) {
// --slide-id side of that same `||` condition).
err := runSlidesShortcut(t, f, stdout, SlidesScreenshot, []string{
"+screenshot",
"--content", `<slide xmlns="http://www.larkoffice.com/sml/2.0"><data></data></slide>`,
"--content", `<slide xmlns="https://www.larkoffice.com/sml/2.0"><data></data></slide>`,
"--slide-number", "0",
"--as", "user",
})
Expand All @@ -830,7 +830,7 @@ func TestSlidesScreenshotRenderAttributesSlideAliasConflictToCallerInput(t *test

err := runSlidesShortcut(t, f, stdout, SlidesScreenshot, []string{
"+screenshot",
"--content", `<slide xmlns="http://www.larkoffice.com/sml/2.0"><data></data></slide>`,
"--content", `<slide xmlns="https://www.larkoffice.com/sml/2.0"><data></data></slide>`,
"--slide", "pII",
"--as", "user",
})
Expand All @@ -855,7 +855,7 @@ func TestSlidesScreenshotRenderIgnoresEmptySlideID(t *testing.T) {

err := runSlidesShortcut(t, f, stdout, SlidesScreenshot, []string{
"+screenshot",
"--content", `<slide xmlns="http://www.larkoffice.com/sml/2.0"><data></data></slide>`,
"--content", `<slide xmlns="https://www.larkoffice.com/sml/2.0"><data></data></slide>`,
"--slide-id", "",
"--dry-run",
"--as", "user",
Expand All @@ -873,7 +873,7 @@ func TestSlidesScreenshotRenderRejectsListOnlyFlags(t *testing.T) {

err := runSlidesShortcut(t, f, stdout, SlidesScreenshot, []string{
"+screenshot",
"--content", `<slide xmlns="http://www.larkoffice.com/sml/2.0"><data></data></slide>`,
"--content", `<slide xmlns="https://www.larkoffice.com/sml/2.0"><data></data></slide>`,
"--presentation", "pres_abc",
"--as", "user",
})
Expand Down Expand Up @@ -911,7 +911,7 @@ func TestSlidesScreenshotDryRunSelectsListOrRenderAPI(t *testing.T) {
f, stdout, _, _ := cmdutil.TestFactory(t, slidesTestConfig(t, ""))
err := runSlidesShortcut(t, f, stdout, SlidesScreenshot, []string{
"+screenshot",
"--content", `<slide xmlns="http://www.larkoffice.com/sml/2.0"><data></data></slide>`,
"--content", `<slide xmlns="https://www.larkoffice.com/sml/2.0"><data></data></slide>`,
"--dry-run",
"--as", "user",
})
Expand Down
4 changes: 2 additions & 2 deletions skills/lark-slides/references/lark-slides-add-slide.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# 追加到末尾(XML 直接作为参数)
lark-cli slides +add-slide --as user \
--presentation "$PID" \
--slide '<slide xmlns="http://www.larkoffice.com/sml/2.0"><data></data></slide>'
--slide '<slide xmlns="https://www.larkoffice.com/sml/2.0"><data></data></slide>'

# XML 从文件读(推荐:避免 shell 转义和长参数截断)
lark-cli slides +add-slide --as user \
Expand Down Expand Up @@ -58,7 +58,7 @@ XML 里写 `<img src="@./chart.png" .../>`,CLI 会:先把每个不重复的
```bash
lark-cli slides +add-slide --as user \
--presentation "$PID" \
--slide '<slide xmlns="http://www.larkoffice.com/sml/2.0"><data><img src="@./chart.png" topLeftX="100" topLeftY="100" width="320" height="180"/></data></slide>'
--slide '<slide xmlns="https://www.larkoffice.com/sml/2.0"><data><img src="@./chart.png" topLeftX="100" topLeftY="100" width="320" height="180"/></data></slide>'
```

- 文件不存在、不是普通文件、超过 20 MB,都在**调用任何接口之前**报错,不会留下半成品。
Expand Down
10 changes: 5 additions & 5 deletions skills/lark-slides/references/lark-slides-create.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ lark-cli slides +create --title "项目汇报"

# 创建 PPT + 添加 slide 页面
lark-cli slides +create --title "项目汇报" --slides '[
"<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><data><shape type=\"text\" topLeftX=\"80\" topLeftY=\"80\" width=\"800\" height=\"120\"><content textType=\"title\"><p>封面</p></content></shape></data></slide>",
"<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><data><shape type=\"text\" topLeftX=\"80\" topLeftY=\"80\" width=\"800\" height=\"120\"><content textType=\"title\"><p>第二页</p></content></shape></data></slide>"
"<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data><shape type=\"text\" topLeftX=\"80\" topLeftY=\"80\" width=\"800\" height=\"120\"><content textType=\"title\"><p>封面</p></content></shape></data></slide>",
"<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data><shape type=\"text\" topLeftX=\"80\" topLeftY=\"80\" width=\"800\" height=\"120\"><content textType=\"title\"><p>第二页</p></content></shape></data></slide>"
]'

# 以应用身份创建(自动授权当前用户)
Expand Down Expand Up @@ -89,8 +89,8 @@ lark-cli slides +create --as user --title "项目汇报" \

```json
[
"<slide xmlns=\"http://www.larkoffice.com/sml/2.0\">...第1页XML...</slide>",
"<slide xmlns=\"http://www.larkoffice.com/sml/2.0\">...第2页XML...</slide>"
"<slide xmlns=\"https://www.larkoffice.com/sml/2.0\">...第1页XML...</slide>",
"<slide xmlns=\"https://www.larkoffice.com/sml/2.0\">...第2页XML...</slide>"
]
```

Expand All @@ -102,7 +102,7 @@ JSON string 数组,每个元素是一页 slide 的完整 XML。CLI 内部负

```bash
lark-cli slides +create --as user --title "图测试" --slides '[
"<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><data><img src=\"@./assets/chart.png\" topLeftX=\"100\" topLeftY=\"100\" width=\"320\" height=\"180\"/></data></slide>"
"<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data><img src=\"@./assets/chart.png\" topLeftX=\"100\" topLeftY=\"100\" width=\"320\" height=\"180\"/></data></slide>"
]'
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ lark-cli slides xml_presentations get --as user --params '<json_params>'
"xml_presentation": {
"presentation_id": "slides_example_presentation_id",
"revision_id": 1,
"content": "<presentation xmlns=\"http://www.larkoffice.com/sml/2.0\" height=\"540\" width=\"960\">...</presentation>"
"content": "<presentation xmlns=\"https://www.larkoffice.com/sml/2.0\" height=\"540\" width=\"960\">...</presentation>"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion skills/lark-slides/references/slides_chart_demo.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<presentation xmlns="/sml/2.0" width="960" height="540">
<presentation xmlns="https://www.larkoffice.com/sml/2.0" width="960" height="540">
<title>原生图表 Chart Demo</title>
<theme>
<textStyles>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:sml="http://www.larkoffice.com/sml/2.0"
targetNamespace="http://www.larkoffice.com/sml/2.0"
xmlns:sml="https://www.larkoffice.com/sml/2.0"
targetNamespace="https://www.larkoffice.com/sml/2.0"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:annotation>
Expand All @@ -11,7 +11,7 @@

版本信息:
- Schema 版本: 2.0.0
- 命名空间: http://www.larkoffice.com/sml/2.0
- 命名空间: https://www.larkoffice.com/sml/2.0
- 发布日期: 2025-11-03
</xs:documentation>
</xs:annotation>
Expand Down
2 changes: 1 addition & 1 deletion skills/lark-slides/references/validation-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ python3 "<lark-slides-skill-dir>/scripts/xml_text_overlap_lint.py" --input <pres
| code | 含义 | 处理方式 |
|------|------|----------|
| `xml_not_well_formed` | XML 语法错误或文本未转义 | 修复标签闭合、属性引号、`&` / `<` / `>` 转义 |
| `sml_prefixed_tag` | SML 元素使用了命名空间前缀,如 `<ns0:slide>` 或 `<sml:shape>` | 使用 `<slide xmlns="http://www.larkoffice.com/sml/2.0">` 的默认命名空间,或使用无前缀标签 |
| `sml_prefixed_tag` | SML 元素使用了命名空间前缀,如 `<ns0:slide>` 或 `<sml:shape>` | 使用 `<slide xmlns="https://www.larkoffice.com/sml/2.0">` 的默认命名空间,或使用无前缀标签 |
| `sxsd_unsupported_tag` | 使用了 SXSD 不支持的标签 | 按 lint `hint` 替换为受支持标签;常见如 `textbox -> <shape type="text">`、`image -> <img>` |
| `sxsd_unsupported_attr` | 支持的标签上使用了不支持的属性 | 按 lint `hint` 改为支持的属性;常见如 `x -> topLeftX`、`fontColor -> color` |
| `iconpark_unsupported_icon_type` | `<icon>` 使用了 `iconpark-index.json` 中不存在的 `iconType` | 按 lint `hint` 改为名单内的 `iconType`,或先用 `scripts/iconpark_tool.py` 搜索 |
Expand Down
10 changes: 5 additions & 5 deletions skills/lark-slides/references/xml-schema-quick-ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## 最重要的规则

1. 协议标准写法应使用 `<presentation xmlns="http://www.larkoffice.com/sml/2.0">`;当前服务端实现可能兼容不带 `xmlns` 的输入,但不作为协议保证
1. 协议标准写法应使用 `<presentation xmlns="https://www.larkoffice.com/sml/2.0">`;当前服务端实现可能兼容不带 `xmlns` 的输入,但不作为协议保证
2. `<presentation>` 直接子元素只有 `<title>`、`<theme>`、`<slide>`
3. `<slide>` 直接子元素只有 `<style>`、`<data>`、`<note>`
4. 页面中的文本通常通过 `<content>` 表达,而不是把 `<title>`、`<body>` 直接挂在 `<slide>` 下
Expand All @@ -13,7 +13,7 @@

```xml
<?xml version="1.0" encoding="UTF-8"?>
<presentation xmlns="http://www.larkoffice.com/sml/2.0" width="960" height="540">
<presentation xmlns="https://www.larkoffice.com/sml/2.0" width="960" height="540">
<slide>
<data>
<shape type="text" topLeftX="80" topLeftY="80" width="800" height="120">
Expand Down Expand Up @@ -418,7 +418,7 @@ XSD 中的 `title`、`headline`、`sub-headline`、`body`、`caption` 主要出

```xml
<?xml version="1.0" encoding="UTF-8"?>
<presentation xmlns="http://www.larkoffice.com/sml/2.0" width="960" height="540">
<presentation xmlns="https://www.larkoffice.com/sml/2.0" width="960" height="540">
<title>季度报告</title>
<theme>
<textStyles>
Expand Down Expand Up @@ -466,7 +466,7 @@ XSD 中的 `title`、`headline`、`sub-headline`、`body`、`caption` 主要出

## 最佳实践

1. 始终带上命名空间 `xmlns="http://www.larkoffice.com/sml/2.0"`
1. 始终带上命名空间 `xmlns="https://www.larkoffice.com/sml/2.0"`
2. 用 `shape type="text"` + `content` 表达页面文本
3. 用 `topLeftX` / `topLeftY`、`startX` / `startY` 等 schema 中定义的属性名
4. 优先使用 `rgb` / `rgba` 颜色格式;渐变必须使用 `rgba()` 且带百分比停靠点
Expand All @@ -481,5 +481,5 @@ XSD 中的 `title`、`headline`、`sub-headline`、`body`、`caption` 主要出
## Schema 版本信息

- **版本**: 2.0.0
- **命名空间**: http://www.larkoffice.com/sml/2.0
- **命名空间**: https://www.larkoffice.com/sml/2.0
- **发布日期**: 2025-11-03
6 changes: 3 additions & 3 deletions skills/lark-slides/scripts/sxsd_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@


XS_NS = "{http://www.w3.org/2001/XMLSchema}"
SML_NAMESPACE = "http://www.larkoffice.com/sml/2.0"
SML_NAMESPACE = "https://www.larkoffice.com/sml/2.0"
SML_LEGACY_HTTP_NAMESPACE = "http://www.larkoffice.com/sml/2.0"
SML_READBACK_NAMESPACE = "/sml/2.0"
SML_HTTPS_READBACK_NAMESPACE = "https://www.larkoffice.com/sml/2.0"
ACCEPTED_SML_NAMESPACES = frozenset(
(SML_NAMESPACE, SML_READBACK_NAMESPACE, SML_HTTPS_READBACK_NAMESPACE)
(SML_NAMESPACE, SML_LEGACY_HTTP_NAMESPACE, SML_READBACK_NAMESPACE)
)


Expand Down
Loading
Loading