iText 8.0.2 API
iText.Kernel.XMP.Impl.Utils Class Reference

Utility functions for the XMPToolkit implementation. More...

Inheritance diagram for iText.Kernel.XMP.Impl.Utils:
iText.Kernel.XMP.XMPConst

Static Public Member Functions

static String  NormalizeLangValue (String value)
  Normalize an xml:lang value so that comparisons are effectively case insensitive as required by RFC 3066 (which superceeds RFC 1766). More...
 
static bool  IsXMLName (String name)
  Simple check for valid XMLNames. More...
 
static bool  IsXMLNameNS (String name)
  Checks if the value is a legal "unqualified" XML name, as defined in the XML Namespaces proposed recommendation. More...
 
static String  EscapeXML (String value, bool forAttribute, bool escapeWhitespaces)
  Serializes the node value in XML encoding. More...
 

Static Public Attributes

const int  UUID_SEGMENT_COUNT = 4
  segments of a UUID More...
 
const int  UUID_LENGTH = 32 + UUID_SEGMENT_COUNT
  length of a UUID More...
 
- Static Public Attributes inherited from iText.Kernel.XMP.XMPConst
const String  NS_XML = "http://www.w3.org/XML/1998/namespace"
  The XML namespace for XML. More...
 
const String  NS_RDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  The XML namespace for RDF. More...
 
const String  NS_DC = "http://purl.org/dc/elements/1.1/"
  The XML namespace for the Dublin Core schema. More...
 
const String  NS_IPTCCORE = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"
  The XML namespace for the IPTC Core schema. More...
 
const String  NS_IPTCEXT = "http://iptc.org/std/Iptc4xmpExt/2008-02-29/"
  The XML namespace for the IPTC Extension schema. More...
 
const String  NS_DICOM = "http://ns.adobe.com/DICOM/"
  The XML namespace for the DICOM medical schema. More...
 
const String  NS_PLUS = "http://ns.useplus.org/ldf/xmp/1.0/"
  The XML namespace for the PLUS (Picture Licensing Universal System, http://www.useplus.org) More...
 
const String  NS_X = "adobe:ns:meta/"
  The XML namespace Adobe XMP Metadata. More...
 
const String  NS_IX = "http://ns.adobe.com/iX/1.0/"
 
const String  NS_XMP = "http://ns.adobe.com/xap/1.0/"
  The XML namespace for the XMP "basic" schema. More...
 
const String  NS_XMP_RIGHTS = "http://ns.adobe.com/xap/1.0/rights/"
  The XML namespace for the XMP copyright schema. More...
 
const String  NS_XMP_MM = "http://ns.adobe.com/xap/1.0/mm/"
  The XML namespace for the XMP digital asset management schema. More...
 
const String  NS_XMP_BJ = "http://ns.adobe.com/xap/1.0/bj/"
  The XML namespace for the job management schema. More...
 
const String  NS_XMP_NOTE = "http://ns.adobe.com/xmp/note/"
  The XML namespace for the job management schema. More...
 
const String  NS_PDF = "http://ns.adobe.com/pdf/1.3/"
  The XML namespace for the PDF schema. More...
 
const String  NS_PDFX = "http://ns.adobe.com/pdfx/1.3/"
  The XML namespace for the PDF schema. More...
 
const String  NS_PDFX_ID = "http://www.npes.org/pdfx/ns/id/"
 
const String  NS_PDFA_SCHEMA = "http://www.aiim.org/pdfa/ns/schema#"
 
const String  NS_PDFA_PROPERTY = "http://www.aiim.org/pdfa/ns/property#"
 
const String  NS_PDFA_TYPE = "http://www.aiim.org/pdfa/ns/type#"
 
const String  NS_PDFA_FIELD = "http://www.aiim.org/pdfa/ns/field#"
 
const String  NS_PDFA_ID = "http://www.aiim.org/pdfa/ns/id/"
 
const String  NS_PDFUA_ID = "http://www.aiim.org/pdfua/ns/id/"
 
const String  NS_PDFA_EXTENSION = "http://www.aiim.org/pdfa/ns/extension/"
 
const String  NS_PHOTOSHOP = "http://ns.adobe.com/photoshop/1.0/"
  The XML namespace for the Photoshop custom schema. More...
 
const String  NS_PSALBUM = "http://ns.adobe.com/album/1.0/"
  The XML namespace for the Photoshop Album schema. More...
 
const String  NS_EXIF = "http://ns.adobe.com/exif/1.0/"
  The XML namespace for Adobe's EXIF schema. More...
 
const String  NS_EXIFX = "http://cipa.jp/exif/1.0/"
  NS for the CIPA XMP for Exif document v1.1 More...
 
const String  NS_EXIF_AUX = "http://ns.adobe.com/exif/1.0/aux/"
 
const String  NS_TIFF = "http://ns.adobe.com/tiff/1.0/"
  The XML namespace for Adobe's TIFF schema. More...
 
const String  NS_PNG = "http://ns.adobe.com/png/1.0/"
 
const String  NS_JPEG = "http://ns.adobe.com/jpeg/1.0/"
 
const String  NS_JP2K = "http://ns.adobe.com/jp2k/1.0/"
 
const String  NS_CAMERARAW = "http://ns.adobe.com/camera-raw-settings/1.0/"
 
const String  NS_ADOBESTOCKPHOTO = "http://ns.adobe.com/StockPhoto/1.0/"
 
const String  NS_CREATOR_ATOM = "http://ns.adobe.com/creatorAtom/1.0/"
 
const String  NS_ASF = "http://ns.adobe.com/asf/1.0/"
 
const String  NS_WAV = "http://ns.adobe.com/xmp/wav/1.0/"
 
const String  NS_BWF = "http://ns.adobe.com/bwf/bext/1.0/"
  BExt Schema More...
 
const String  NS_RIFFINFO = "http://ns.adobe.com/riff/info/"
  RIFF Info Schema More...
 
const String  NS_SCRIPT = "http://ns.adobe.com/xmp/1.0/Script/"
 
const String  NS_TXMP = "http://ns.adobe.com/TransformXMP/"
  Transform XMP More...
 
const String  NS_SWF = "http://ns.adobe.com/swf/1.0/"
  Adobe Flash SWF More...
 
const String  NS_DM = "http://ns.adobe.com/xmp/1.0/DynamicMedia/"
 
const String  NS_TRANSIENT = "http://ns.adobe.com/xmp/transient/1.0/"
 
const String  NS_DC_DEPRECATED = "http://purl.org/dc/1.1/"
  legacy Dublin Core NS, will be converted to NS_DC More...
 
const String  TYPE_IDENTIFIERQUAL = "http://ns.adobe.com/xmp/Identifier/qual/1.0/"
  The XML namespace for qualifiers of the xmp:Identifier property. More...
 
const String  TYPE_DIMENSIONS = "http://ns.adobe.com/xap/1.0/sType/Dimensions#"
  The XML namespace for fields of the Dimensions type. More...
 
const String  TYPE_TEXT = "http://ns.adobe.com/xap/1.0/t/"
 
const String  TYPE_PAGEDFILE = "http://ns.adobe.com/xap/1.0/t/pg/"
 
const String  TYPE_GRAPHICS = "http://ns.adobe.com/xap/1.0/g/"
 
const String  TYPE_IMAGE = "http://ns.adobe.com/xap/1.0/g/img/"
  The XML namespace for fields of a graphical image. More...
 
const String  TYPE_FONT = "http://ns.adobe.com/xap/1.0/sType/Font#"
 
const String  TYPE_RESOURCEEVENT = "http://ns.adobe.com/xap/1.0/sType/ResourceEvent#"
  The XML namespace for fields of the ResourceEvent type. More...
 
const String  TYPE_RESOURCEREF = "http://ns.adobe.com/xap/1.0/sType/ResourceRef#"
  The XML namespace for fields of the ResourceRef type. More...
 
const String  TYPE_ST_VERSION = "http://ns.adobe.com/xap/1.0/sType/Version#"
  The XML namespace for fields of the Version type. More...
 
const String  TYPE_ST_JOB = "http://ns.adobe.com/xap/1.0/sType/Job#"
  The XML namespace for fields of the JobRef type. More...
 
const String  TYPE_MANIFESTITEM = "http://ns.adobe.com/xap/1.0/sType/ManifestItem#"
 
const String  TRUESTR = "True"
  The canonical true string value for Booleans in serialized XMP. More...
 
const String  FALSESTR = "False"
  The canonical false string value for Booleans in serialized XMP. More...
 
const int  ARRAY_LAST_ITEM = -1
  Index that has the meaning to be always the last item in an array. More...
 
const String  ARRAY_ITEM_NAME = "[]"
  Node name of an array item. More...
 
const String  X_DEFAULT = "x-default"
  The x-default string for localized properties More...
 
const String  XML_LANG = "xml:lang"
  xml:lang qualfifier More...
 
const String  RDF_TYPE = "rdf:type"
  rdf:type qualfifier More...
 
const String  XMP_PI = "xpacket"
  Processing Instruction (PI) for xmp packet More...
 
const String  TAG_XMPMETA = "xmpmeta"
  XMP meta tag version new More...
 
const String  TAG_XAPMETA = "xapmeta"
  XMP meta tag version old More...
 
const String  PART = "part"
  Part, 1, 2, or 3 More...
 
const String  REV = "rev"
  ISO 19005 revision More...
 
const String  CONFORMANCE = "conformance"
  Conformance, A, B, or U. More...
 
const String  HISTORY = "History"
  History More...
 

Detailed Description

Utility functions for the XMPToolkit implementation.

06.06.2006

Member Function Documentation

◆ EscapeXML()

static String iText.Kernel.XMP.Impl.Utils.EscapeXML ( String  value,
bool  forAttribute,
bool  escapeWhitespaces 
)
inlinestatic

Serializes the node value in XML encoding.

Serializes the node value in XML encoding. Its used for tag bodies and attributes.
Note: The attribute is always limited by quotes, thats why ' is never serialized.
Note: Control chars are written unescaped, but if the user uses others than tab, LF and CR the resulting XML will become invalid.

Parameters
value a string
forAttribute flag if string is attribute value (need to additional escape quotes)
escapeWhitespaces Decides if LF, CR and TAB are escaped.
Returns
Returns the value ready for XML output.

◆ IsXMLName()

static bool iText.Kernel.XMP.Impl.Utils.IsXMLName ( String  name )
inlinestatic

Simple check for valid XMLNames.

Simple check for valid XMLNames. Within ASCII range
":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6]
are accepted, above all characters (which is not entirely correct according to the XML Spec.

Parameters
name an XML Name
Returns
Return true if the name is correct.

◆ IsXMLNameNS()

static bool iText.Kernel.XMP.Impl.Utils.IsXMLNameNS ( String  name )
inlinestatic

Checks if the value is a legal "unqualified" XML name, as defined in the XML Namespaces proposed recommendation.

Checks if the value is a legal "unqualified" XML name, as defined in the XML Namespaces proposed recommendation. These are XML names, except that they must not contain a colon.

Parameters
name the value to check
Returns
Returns true if the name is a valid "unqualified" XML name.

◆ NormalizeLangValue()

static String iText.Kernel.XMP.Impl.Utils.NormalizeLangValue ( String  value )
inlinestatic

Normalize an xml:lang value so that comparisons are effectively case insensitive as required by RFC 3066 (which superceeds RFC 1766).

Normalize an xml:lang value so that comparisons are effectively case insensitive as required by RFC 3066 (which superceeds RFC 1766). The normalization rules:

  • The primary subtag is lower case, the suggested practice of ISO 639.
  • All 2 letter secondary subtags are upper case, the suggested practice of ISO 3166.
  • All other subtags are lower case.
Parameters
value raw value
Returns
Returns the normalized value.

Member Data Documentation

◆ UUID_LENGTH

const int iText.Kernel.XMP.Impl.Utils.UUID_LENGTH = 32 + UUID_SEGMENT_COUNT
static

length of a UUID

◆ UUID_SEGMENT_COUNT

const int iText.Kernel.XMP.Impl.Utils.UUID_SEGMENT_COUNT = 4
static

segments of a UUID