Skip to main content
Skip table of contents

XmpNodeUtils

XmpNodeUtils Public class

Description

Utilities for ...

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph iTextSharp.xmp.impl
  iTextSharp.xmp.impl.XmpNodeUtils[[XmpNodeUtils]]
  end
  subgraph iTextSharp.xmp
  iTextSharp.xmp.XmpConst[[XmpConst]]
  end
iTextSharp.xmp.XmpConst --> iTextSharp.xmp.impl.XmpNodeUtils

Members

Methods

Internal Static methods
ReturnsName
voidAppendLangItem(XmpNode arrayNode, string itemLang, string itemValue)
Appends a language item to an alt text array.
object``[]ChooseLocalizedText(XmpNode arrayNode, string genericLang, string specificLang)
voidDeleteNode(XmpNode node)
Deletes the the given node and its children from its parent.
Takes care about adjusting the flags.
voidDetectAltText(XmpNode arrayNode)
See if an array is an alt-text array. If so, make sure the x-default item
is first.
XmpNodeFindChildNode(XmpNode parent, string childName, bool createNodes)
Find or create a child node under a given parent node. If the parent node is no
Returns the found or created child node.
XmpNodeFindNode(XmpNode xmpTree, XmpPath xpath, bool createNodes, PropertyOptions leafOptions)
Follow an expanded path expression to find or create a node.
XmpNodeFindSchemaNode(...)
Find or create a schema node if ...
intLookupLanguageItem(XmpNode arrayNode, string language)
Looks for the appropriate language item in a text alternative array.item
voidNormalizeLangArray(XmpNode arrayNode)
Make sure the x-default item is first. Touch up "single value"
arrays that have a default plus one real language. This case should have
the same value for both items. Older Adobe apps were hardwired to only
use the "x-default" item, so we copy that value to the other
item.
stringSerializeNodeValue(object value)
Converts the node value to String, apply special conversions for defined
types in XMP.
voidSetNodeValue(XmpNode node, object value)
This is setting the value of a leaf node.
PropertyOptionsVerifySetOptions(PropertyOptions options, object itemValue)
Verifies the PropertyOptions for consistancy and updates them as needed.
If options are ...

Details

Summary

Utilities for

XMPNode

Inheritance

Methods

FindSchemaNode [1/2]

Source code

internal static XmpNode FindSchemaNode(XmpNode tree, string namespaceUri, bool createNodes)
Arguments
TypeNameDescription
XmpNodetreethe root of the xmp tree.
stringnamespaceUria namespace
boolcreateNodesa flag indicating if the node shall be created if not found. Note: The namespace must be registered prior to this call.
Summary

Find or create a schema node if

createNodes
Returns

Returns the schema node if found,

null

otherwise. Note: If

createNodes

is

true
Exceptions
NameDescription
XmpExceptionAn exception is only thrown if an error occurred, not if a
node was not found.
FindSchemaNode [2/2]

Source code

internal static XmpNode FindSchemaNode(XmpNode tree, string namespaceUri, string suggestedPrefix, bool createNodes)
Arguments
TypeNameDescription
XmpNodetreethe root of the xmp tree.
stringnamespaceUria namespace
stringsuggestedPrefixIf a prefix is suggested, the namespace is allowed to be registered.
boolcreateNodesa flag indicating if the node shall be created if not found. Note: The namespace must be registered prior to this call.
Summary

Find or create a schema node if

createNodes
Returns

Returns the schema node if found,

null

otherwise. Note: If

createNodes

is

true
Exceptions
NameDescription
XmpExceptionAn exception is only thrown if an error occurred, not if a
node was not found.
FindChildNode

Source code

internal static XmpNode FindChildNode(XmpNode parent, string childName, bool createNodes)
Arguments
TypeNameDescription
XmpNodeparentthe parent node
stringchildNamethe node name to find
boolcreateNodesflag, if new nodes shall be created.
Summary

Find or create a child node under a given parent node. If the parent node is no Returns the found or created child node.

Returns

Returns the found or created node or

null
Exceptions
NameDescription
XmpExceptionThrown if
FindNode

Source code

internal static XmpNode FindNode(XmpNode xmpTree, XmpPath xpath, bool createNodes, PropertyOptions leafOptions)
Arguments
TypeNameDescription
XmpNodexmpTreethe node to begin the search.
XmpPathxpaththe complete xpath
boolcreateNodesflag if nodes shall be created
(when called by ...
PropertyOptionsleafOptionsthe options for the created leaf nodes (only when ...
Summary

Follow an expanded path expression to find or create a node.

Returns

Returns the node if found or created or

null
Exceptions
NameDescription
XmpExceptionAn exception is only thrown if an error occurred,
not if a node was not found.
DeleteNode

Source code

internal static void DeleteNode(XmpNode node)
Arguments
TypeNameDescription
XmpNodenodethe top-most node to delete.
Summary

Deletes the the given node and its children from its parent. Takes care about adjusting the flags.

SetNodeValue

Source code

internal static void SetNodeValue(XmpNode node, object value)
Arguments
TypeNameDescription
XmpNodenodean XMPNode
objectvaluea value
Summary

This is setting the value of a leaf node.

VerifySetOptions

Source code

internal static PropertyOptions VerifySetOptions(PropertyOptions options, object itemValue)
Arguments
TypeNameDescription
PropertyOptionsoptionsthe ...
objectitemValuethe node value to set
Summary

Verifies the PropertyOptions for consistancy and updates them as needed. If options are

null
Returns

Returns the updated options.

Exceptions
NameDescription
XmpExceptionIf the options are not consistant.
SerializeNodeValue

Source code

internal static string SerializeNodeValue(object value)
Arguments
TypeNameDescription
objectvaluethe node value to set
Summary

Converts the node value to String, apply special conversions for defined types in XMP.

Returns

Returns the String representation of the node value.

NormalizeLangArray

Source code

internal static void NormalizeLangArray(XmpNode arrayNode)
Arguments
TypeNameDescription
XmpNodearrayNodean alt text array node
Summary

Make sure the x-default item is first. Touch up "single value" arrays that have a default plus one real language. This case should have the same value for both items. Older Adobe apps were hardwired to only use the "x-default" item, so we copy that value to the other item.

DetectAltText

Source code

internal static void DetectAltText(XmpNode arrayNode)
Arguments
TypeNameDescription
XmpNodearrayNodethe array node to check if its an alt-text array
Summary

See if an array is an alt-text array. If so, make sure the x-default item is first.

AppendLangItem

Source code

internal static void AppendLangItem(XmpNode arrayNode, string itemLang, string itemValue)
Arguments
TypeNameDescription
XmpNodearrayNodethe language array
stringitemLangthe language of the item
stringitemValuethe content of the item
Summary

Appends a language item to an alt text array.

Exceptions
NameDescription
XmpExceptionThrown if a duplicate property is added
ChooseLocalizedText

Source code

internal static object ChooseLocalizedText(XmpNode arrayNode, string genericLang, string specificLang)
Arguments
TypeNameDescription
XmpNodearrayNode
stringgenericLang
stringspecificLang
LookupLanguageItem

Source code

internal static int LookupLanguageItem(XmpNode arrayNode, string language)
Arguments
TypeNameDescription
XmpNodearrayNodean array node
stringlanguagethe requested language
Summary

Looks for the appropriate language item in a text alternative array.item

Returns

Returns the index if the language has been found, -1 otherwise.

Exceptions
NameDescription
XmpException

Generated with ModularDoc

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.