文本格式化发生在哪里?
Where does the text formatting take place?
我有 XML 的这一部分(我从外部来源获得)
> <ListOfStructuredNote>
> <StructuredNote>
> <GeneralNote>Part APart B</GeneralNote>
> <NoteID>Info record PO text</NoteID>
> <Agency>
> <AgencyCoded>Other</AgencyCoded>
> <AgencyCodedOther>asdasd</AgencyCodedOther>
> </Agency>
> </StructuredNote>
> </ListOfStructuredNote>
(完整)XML 将使用 Lotusscript 进行解析。函数:CreateDOMParser
将用于解析 XML.
最终我需要元素内部的 GeneralNote 元素的值:ListOfStructure。使用以下代码,我可以检索 GeneralNote 的值并将其放入名为 : note 的变量中,该变量是 String 类型。 Lotusscript 中的代码:
ret = getFieldValue(Node, "ListOfStructuredNote", "String")
note = ""
If Not ChildNode Is Nothing Then
numChildren = ChildNode.NumberOfChildNodes
Set child = ChildNode.FirstChild ' Get child
While numChildren > 0
If Child.NodeType = 1 Then
If Not Child.FirstChild.FirstChild.isNull Then
note = note + Child.FirstChild.FirstChild.NodeValue
End If
End If
Set child = child.NextSibling ' Get next child
numChildren = numChildren - 1
Wend
End If
当变量 note 保存到 Lotus 文档字段(类型文本列表)中时,我将其视为输出:
A部分(换行)
B 部分
怎么可能有换行符。因为如果我在像 vscode 或 sublime text 3 这样的文本编辑器中打开 XML,那么我看不到任何换行符。所以我要问的是:如何检测任何格式?
尝试使用具有显示隐藏字符功能的其他文本编辑器。
例如使用Notepad++和select查看-显示符号-显示所有字符。您可能会发现 A 部分和 B 部分之间确实存在一些东西。
我有 XML 的这一部分(我从外部来源获得)
> <ListOfStructuredNote>
> <StructuredNote>
> <GeneralNote>Part APart B</GeneralNote>
> <NoteID>Info record PO text</NoteID>
> <Agency>
> <AgencyCoded>Other</AgencyCoded>
> <AgencyCodedOther>asdasd</AgencyCodedOther>
> </Agency>
> </StructuredNote>
> </ListOfStructuredNote>
(完整)XML 将使用 Lotusscript 进行解析。函数:CreateDOMParser
将用于解析 XML.
最终我需要元素内部的 GeneralNote 元素的值:ListOfStructure。使用以下代码,我可以检索 GeneralNote 的值并将其放入名为 : note 的变量中,该变量是 String 类型。 Lotusscript 中的代码:
ret = getFieldValue(Node, "ListOfStructuredNote", "String")
note = ""
If Not ChildNode Is Nothing Then
numChildren = ChildNode.NumberOfChildNodes
Set child = ChildNode.FirstChild ' Get child
While numChildren > 0
If Child.NodeType = 1 Then
If Not Child.FirstChild.FirstChild.isNull Then
note = note + Child.FirstChild.FirstChild.NodeValue
End If
End If
Set child = child.NextSibling ' Get next child
numChildren = numChildren - 1
Wend
End If
当变量 note 保存到 Lotus 文档字段(类型文本列表)中时,我将其视为输出: A部分(换行) B 部分
怎么可能有换行符。因为如果我在像 vscode 或 sublime text 3 这样的文本编辑器中打开 XML,那么我看不到任何换行符。所以我要问的是:如何检测任何格式?
尝试使用具有显示隐藏字符功能的其他文本编辑器。
例如使用Notepad++和select查看-显示符号-显示所有字符。您可能会发现 A 部分和 B 部分之间确实存在一些东西。