/**
         * Construct for Xpath2 expression. Depends from selected xdp package.
         * @param xdpPackage
         */
        public XfaXpathConstructor(XdpPackage xdpPackage) {
            String strPackage;
            switch (xdpPackage) {
                case XdpPackage.Config:
                    strPackage = CONFIG;
                    break;
                case XdpPackage.ConnectionSet:
                    strPackage = CONNECTIONSET;
                    break;
                case XdpPackage.Datasets:
                    strPackage = DATASETS;
                    break;
                case XdpPackage.LocaleSet:
                    strPackage = LOCALESET;
                    break;
                case XdpPackage.Pdf:
                    strPackage = PDF;
                    break;
                case XdpPackage.SourceSet:
                    strPackage = SOURCESET;
                    break;
                case XdpPackage.Stylesheet:
                    strPackage = STYLESHEET;
                    break;
                case XdpPackage.Template:
                    strPackage = TEMPLATE;
                    break;
                case XdpPackage.Xdc:
                    strPackage = XDC;
                    break;
                case XdpPackage.Xfdf:
                    strPackage = XFDF;
                    break;
                case XdpPackage.Xmpmeta:
                    strPackage = XMPMETA;
                    break;
                default:
                    xpathExpression = "";
                    return;
            }

            StringBuilder builder = new StringBuilder("/xdp:xdp/*[local-name()='");
            builder.Append(strPackage);
            builder.Append("']");
            xpathExpression = builder.ToString();
        }
Exemple #2
0
        /**
         * Construct for Xpath expression. Depends from selected xdp package.
         * @param xdpPackage
         */
        public XfaXpathConstructor(XdpPackage xdpPackage) {
            String strPackage;
            switch (xdpPackage) {
                case XdpPackage.Config:
                    strPackage = CONFIG;
                    break;
                case XdpPackage.ConnectionSet:
                    strPackage = CONNECTIONSET;
                    break;
                case XdpPackage.Datasets:
                    strPackage = DATASETS;
                    break;
                case XdpPackage.LocaleSet:
                    strPackage = LOCALESET;
                    break;
                case XdpPackage.Pdf:
                    strPackage = PDF;
                    break;
                case XdpPackage.SourceSet:
                    strPackage = SOURCESET;
                    break;
                case XdpPackage.Stylesheet:
                    strPackage = STYLESHEET;
                    break;
                case XdpPackage.Template:
                    strPackage = TEMPLATE;
                    break;
                case XdpPackage.Xdc:
                    strPackage = XDC;
                    break;
                case XdpPackage.Xfdf:
                    strPackage = XFDF;
                    break;
                case XdpPackage.Xmpmeta:
                    strPackage = XMPMETA;
                    break;
                default:
                    xpathExpression = "";
                    return;
            }

            StringBuilder builder = new StringBuilder("/xdp:xdp/*[local-name()='");
            builder.Append(strPackage).Append("']");
            xpathExpression = builder.ToString();
            namespaceManager = new XmlNamespaceManager(new NameTable());
            namespaceManager.AddNamespace("xdp", "http://ns.adobe.com/xdp/");
        }